@mscharley/eslint-config 4.0.2 → 4.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/README.md +8 -0
- package/package.json +48 -48
- package/rules/index.js +4 -2
- package/rules/testing.js +4 -1
- package/rules/typescript.js +16 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Change Log - @mscharley/eslint-config
|
|
2
2
|
|
|
3
|
+
## 4.0.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 93ffd4d: fix(deps): update dependency typescript to v5.6.3
|
|
8
|
+
- 1a77c06: fix(deps): update dependency typescript-eslint to ^8.8.1
|
|
9
|
+
|
|
10
|
+
## 4.0.3
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- 7d2169b: Prevent better support for linting JS files
|
|
15
|
+
- 4872523: Apply testing fixes to **mocks** as well as **utils**
|
|
16
|
+
|
|
3
17
|
## 4.0.2
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -45,6 +45,14 @@ If using Prettier to format files other than TypeScript and JavaScript files the
|
|
|
45
45
|
**/*.js
|
|
46
46
|
```
|
|
47
47
|
|
|
48
|
+
### Usage in JavaScript projects
|
|
49
|
+
|
|
50
|
+
```
|
|
51
|
+
Parsing error: [...]/configFile.js was not found by the project service. Consider either including it in the tsconfig.json or including it in allowDefaultProject
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
If you get messages like this, you can disable type-checked rules using the `disableTypeCheckedRules()` helper function exported by this module. This takes a list of file paths and returns a single configuration object. This takes into account all type checked rules enabled by this configuration and is a superset of the helper configuration provided by `typescript-eslint` for a similar purpose.
|
|
55
|
+
|
|
48
56
|
[gh-contrib]: https://github.com/mscharley/node-presets/graphs/contributors
|
|
49
57
|
[gh-issues]: https://github.com/mscharley/node-presets/issues
|
|
50
58
|
[license]: https://github.com/mscharley/node-presets/blob/main/LICENSE
|
package/package.json
CHANGED
|
@@ -1,49 +1,49 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
2
|
+
"name": "@mscharley/eslint-config",
|
|
3
|
+
"version": "4.0.4",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"module": "./rules/index.js",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": {
|
|
8
|
+
"import": "./rules/index.js"
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
"publishConfig": {
|
|
12
|
+
"provenance": true
|
|
13
|
+
},
|
|
14
|
+
"description": "ESLint presets that I use a lot",
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "git+https://github.com/mscharley/node-presets.git"
|
|
18
|
+
},
|
|
19
|
+
"keywords": [
|
|
20
|
+
"eslint",
|
|
21
|
+
"eslint-presets"
|
|
22
|
+
],
|
|
23
|
+
"author": "Matthew Scharley <matt@scharley.me>",
|
|
24
|
+
"funding": {
|
|
25
|
+
"type": "individual",
|
|
26
|
+
"url": "https://github.com/sponsors/mscharley"
|
|
27
|
+
},
|
|
28
|
+
"license": "MIT",
|
|
29
|
+
"bugs": {
|
|
30
|
+
"url": "https://github.com/mscharley/node-presets/issues"
|
|
31
|
+
},
|
|
32
|
+
"homepage": "https://github.com/mscharley/node-presets#readme",
|
|
33
|
+
"peerDependencies": {
|
|
34
|
+
"@stylistic/eslint-plugin": "^2.9.0",
|
|
35
|
+
"@types/eslint": "^9.6.1",
|
|
36
|
+
"eslint": "^9.12.0",
|
|
37
|
+
"eslint-import-resolver-typescript": "^3.6.3",
|
|
38
|
+
"eslint-plugin-import": "^2.31.0",
|
|
39
|
+
"eslint-plugin-jest": "^28.8.3",
|
|
40
|
+
"eslint-plugin-n": "^17.10.3",
|
|
41
|
+
"eslint-plugin-react": "^7.37.1",
|
|
42
|
+
"eslint-plugin-react-hooks": "5.1.0-beta-26f2496093-20240514",
|
|
43
|
+
"typescript": "^5.6.3",
|
|
44
|
+
"typescript-eslint": "^8.8.1"
|
|
45
|
+
},
|
|
46
|
+
"scripts": {
|
|
47
|
+
"test": "eslint --max-warnings 0 ."
|
|
48
|
+
}
|
|
49
|
+
}
|
package/rules/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import typescript, { disableTypeCheckedRules } from './typescript.js';
|
|
1
2
|
import eslint from './eslint.js';
|
|
2
3
|
import node from './node.js';
|
|
3
4
|
import react from './react.js';
|
|
4
5
|
import stylistic from '@stylistic/eslint-plugin';
|
|
5
6
|
import testing from './testing.js';
|
|
6
|
-
import typescript from './typescript.js';
|
|
7
7
|
|
|
8
8
|
export const configs = {
|
|
9
9
|
recommended: [
|
|
@@ -37,4 +37,6 @@ export const withStyles = () => [
|
|
|
37
37
|
},
|
|
38
38
|
];
|
|
39
39
|
|
|
40
|
-
export
|
|
40
|
+
export { disableTypeCheckedRules };
|
|
41
|
+
|
|
42
|
+
export default { configs, disableTypeCheckedRules, withStyles };
|
package/rules/testing.js
CHANGED
package/rules/typescript.js
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
import { configs as tseslint } from 'typescript-eslint';
|
|
2
2
|
|
|
3
|
+
export const disableTypeCheckedRules = (...files) => ({
|
|
4
|
+
files,
|
|
5
|
+
...tseslint.disableTypeChecked,
|
|
6
|
+
rules: {
|
|
7
|
+
...tseslint.disableTypeChecked.rules,
|
|
8
|
+
'@typescript-eslint/explicit-function-return-type': 'off',
|
|
9
|
+
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
|
10
|
+
},
|
|
11
|
+
});
|
|
12
|
+
|
|
3
13
|
/** @type import('eslint').Config[] */
|
|
4
14
|
export default [
|
|
5
15
|
...tseslint.recommendedTypeChecked,
|
|
@@ -11,9 +21,6 @@ export default [
|
|
|
11
21
|
},
|
|
12
22
|
},
|
|
13
23
|
{
|
|
14
|
-
files: [
|
|
15
|
-
'**/*.ts', '**/*.tsx', '**/*.mts', '**/*.cts',
|
|
16
|
-
],
|
|
17
24
|
rules: {
|
|
18
25
|
'@typescript-eslint/no-deprecated': 'warn',
|
|
19
26
|
'@typescript-eslint/array-type': [
|
|
@@ -128,8 +135,13 @@ export default [
|
|
|
128
135
|
'@typescript-eslint/no-unused-vars': [
|
|
129
136
|
'warn',
|
|
130
137
|
{
|
|
138
|
+
args: 'all',
|
|
131
139
|
argsIgnorePattern: '^_',
|
|
140
|
+
caughtErrors: 'all',
|
|
141
|
+
caughtErrorsIgnorePattern: '^_',
|
|
142
|
+
destructuredArrayIgnorePattern: '^_',
|
|
132
143
|
varsIgnorePattern: '^_',
|
|
144
|
+
ignoreRestSiblings: true,
|
|
133
145
|
},
|
|
134
146
|
],
|
|
135
147
|
'@typescript-eslint/no-unnecessary-boolean-literal-compare': [
|
|
@@ -174,4 +186,5 @@ export default [
|
|
|
174
186
|
'@typescript-eslint/switch-exhaustiveness-check': 'error',
|
|
175
187
|
},
|
|
176
188
|
},
|
|
189
|
+
disableTypeCheckedRules('*.config.js'),
|
|
177
190
|
];
|