Skip to content

Commit 9ee8ff1

Browse files
authored
Merge pull request #17 from climatiq/v2
V2
2 parents 6be6844 + a9763d5 commit 9ee8ff1

File tree

3 files changed

+1194
-1039
lines changed

3 files changed

+1194
-1039
lines changed

index.js

+48-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,52 @@
11
module.exports = {
2-
extends: ['next/core-web-vitals', 'plugin:@typescript-eslint/recommended', 'prettier'],
2+
extends: ['next/core-web-vitals', 'plugin:@typescript-eslint/recommended-type-checked', 'prettier'],
3+
plugins: [
4+
// This plugin automatically removes unused imports
5+
"unused-imports"
6+
],
37
rules: {
48
'curly': 'error',
59
'no-console': 2,
6-
'@typescript-eslint/ban-ts-comment': 1,
7-
'@typescript-eslint/no-unused-vars': 2,
8-
"@typescript-eslint/no-empty-function": "off"
9-
}
10-
}
10+
// Sometimes ts-ignore is handy if we justify it
11+
'@typescript-eslint/ban-ts-comment': [
12+
'warn',
13+
{
14+
'ts-check': 'allow-with-description',
15+
'ts-expect-error': 'allow-with-description',
16+
'ts-ignore': 'allow-with-description',
17+
'ts-nocheck': 'allow-with-description',
18+
},
19+
],
20+
"@typescript-eslint/no-empty-function": "off",
21+
'@typescript-eslint/no-unused-vars': 'off', // delegate to plugin below that handles both vars and imports
22+
'unused-imports/no-unused-imports': 'error',
23+
'unused-imports/no-unused-vars': [
24+
'warn',
25+
{ vars: 'all', varsIgnorePattern: '^_', args: 'after-used', argsIgnorePattern: '^_' },
26+
],
27+
},
28+
29+
parserOptions: {
30+
project: true,
31+
tsconfigRootDir: "./tsconfig.json",
32+
},
33+
overrides: [
34+
{
35+
files: ['**/*.test.ts', '**/*/test-stubs.ts', '**/*/test-helpers.ts'],
36+
rules: {
37+
// Handy to have all tests be async even if we don't use it in them
38+
'@typescript-eslint/require-await': 'off',
39+
// No need to be super strict with anys in test code
40+
// Also these don't seem to work well with snapshot matchers
41+
'@typescript-eslint/no-unsafe-argument': 'off',
42+
'@typescript-eslint/no-unsafe-assignment': 'off',
43+
},
44+
},
45+
{
46+
//see https://typescript-eslint.io/troubleshooting/#i-get-errors-telling-me-eslint-was-configured-to-run--however-that-tsconfig-does-not--none-of-those-tsconfigs-include-this-file
47+
// This is to avoid errors about this not being in the TSConfig
48+
extends: ['plugin:@typescript-eslint/disable-type-checked'],
49+
files: ['./**/*.js'],
50+
}
51+
],
52+
}

package.json

+6-10
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@climatiq/eslint-config",
3-
"version": "1.0.10",
3+
"version": "2.0.0",
44
"description": "ESlint configuration for Climatiq projects",
55
"main": "index.js",
66
"repository": {
@@ -15,7 +15,7 @@
1515
"eslint"
1616
],
1717
"author": "Climatiq",
18-
"license": "GPL-2.0-or-later",
18+
"license": "MIT",
1919
"bugs": {
2020
"url": "https://github.com/climatiq/eslint-config-climatiq/issues"
2121
},
@@ -26,22 +26,18 @@
2626
"peerDependencies": {
2727
"@next/eslint-plugin-next": "^13.4.6",
2828
"@typescript-eslint/eslint-plugin": ">=5.3.1",
29-
"@typescript-eslint/parser": ">=5.3.1",
3029
"eslint-config-prettier": ">=8.3.0",
3130
"eslint-plugin-prettier": ">=4.0.0",
3231
"eslint-webpack-plugin": "^4.0.1",
33-
"prettier": "^3.0.1"
32+
"prettier": "^>=3",
33+
"typescript": ">5"
3434
},
3535
"dependencies": {
36-
"@typescript-eslint/eslint-plugin": ">=5.3.1",
3736
"@typescript-eslint/parser": ">=5.3.1",
38-
"eslint": "^8.42.0",
37+
"eslint": "^8",
3938
"eslint-config-next": "^13.4.6",
4039
"eslint-config-prettier": ">=8.3.0",
41-
"eslint-plugin-prettier": ">=4.0.0",
42-
"prettier": "^3.0.1",
43-
"semver": "^7.5.3",
44-
"typescript": "^5.1.3"
40+
"eslint-plugin-prettier": ">=4.0.0"
4541
},
4642
"publishConfig": {
4743
"access": "public"

0 commit comments

Comments
 (0)