@mscharley/eslint-config 4.0.0 → 4.0.2
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 +13 -0
- package/README.md +9 -28
- package/package.json +1 -1
- package/rules/testing.js +7 -0
- package/rules/typescript.js +5 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# Change Log - @mscharley/eslint-config
|
|
2
2
|
|
|
3
|
+
## 4.0.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- ab92718: Cleanup some of the testing rules
|
|
8
|
+
- 7d6a205: Fix readme for flat configurations
|
|
9
|
+
|
|
10
|
+
## 4.0.1
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- d680c72: Fix an issue with detecting typescript projects
|
|
15
|
+
|
|
3
16
|
## 4.0.0
|
|
4
17
|
|
|
5
18
|
### Major Changes
|
package/README.md
CHANGED
|
@@ -20,15 +20,15 @@ $ npm install --save-dev @mscharley/eslint-config
|
|
|
20
20
|
## Usage
|
|
21
21
|
|
|
22
22
|
```js
|
|
23
|
-
// .
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
//
|
|
30
|
-
|
|
31
|
-
|
|
23
|
+
// eslint.config.js
|
|
24
|
+
import { configs, withStyles } from "@mscharley/eslint-config";
|
|
25
|
+
|
|
26
|
+
export const [
|
|
27
|
+
...configs.recommended,
|
|
28
|
+
...configs.node, // For projects running on NodeJS
|
|
29
|
+
// ...configs.react, // For projects running React
|
|
30
|
+
...withStyles(), // Include formatting rules
|
|
31
|
+
];
|
|
32
32
|
```
|
|
33
33
|
|
|
34
34
|
### Notes on Prettier
|
|
@@ -45,25 +45,6 @@ If using Prettier to format files other than TypeScript and JavaScript files the
|
|
|
45
45
|
**/*.js
|
|
46
46
|
```
|
|
47
47
|
|
|
48
|
-
## Extras
|
|
49
|
-
|
|
50
|
-
### Deprecation warnings for JavaScript files
|
|
51
|
-
|
|
52
|
-
As a general rule we can't enable the `deprecation/deprecation` rule for JavaScript files because this rule requires TypeScript type information to work. If you have a mixed TypeScript/JavaScript project then you can enable it for the JavaScript files inside your TypeScript project using the following override:
|
|
53
|
-
|
|
54
|
-
```js
|
|
55
|
-
// .eslintrc.js
|
|
56
|
-
module.exports = {
|
|
57
|
-
overrides: [
|
|
58
|
-
{
|
|
59
|
-
// This must be a valid path inside your TypeScript source folders.
|
|
60
|
-
files: ["src/**/*.{js,jsx}"],
|
|
61
|
-
rules: { "deprecation/deprecation": "warn" },
|
|
62
|
-
},
|
|
63
|
-
],
|
|
64
|
-
};
|
|
65
|
-
```
|
|
66
|
-
|
|
67
48
|
[gh-contrib]: https://github.com/mscharley/node-presets/graphs/contributors
|
|
68
49
|
[gh-issues]: https://github.com/mscharley/node-presets/issues
|
|
69
50
|
[license]: https://github.com/mscharley/node-presets/blob/main/LICENSE
|
package/package.json
CHANGED
package/rules/testing.js
CHANGED
|
@@ -22,6 +22,7 @@ export default [
|
|
|
22
22
|
files: jestFiles,
|
|
23
23
|
rules: {
|
|
24
24
|
'@typescript-eslint/consistent-type-assertions': 'off',
|
|
25
|
+
'@typescript-eslint/no-magic-numbers': 'off',
|
|
25
26
|
'jest/prefer-todo': 'error',
|
|
26
27
|
'jest/no-conditional-in-test': 'warn',
|
|
27
28
|
'jest/no-untyped-mock-factory': 'error',
|
|
@@ -35,4 +36,10 @@ export default [
|
|
|
35
36
|
],
|
|
36
37
|
},
|
|
37
38
|
},
|
|
39
|
+
{
|
|
40
|
+
files: ['**/__utils__/**/*.ts'],
|
|
41
|
+
rules: {
|
|
42
|
+
'jest/no-export': 'off',
|
|
43
|
+
},
|
|
44
|
+
},
|
|
38
45
|
];
|
package/rules/typescript.js
CHANGED
|
@@ -4,14 +4,16 @@ import { configs as tseslint } from 'typescript-eslint';
|
|
|
4
4
|
export default [
|
|
5
5
|
...tseslint.recommendedTypeChecked,
|
|
6
6
|
{
|
|
7
|
-
files: [
|
|
8
|
-
'**/*.ts', '**/*.tsx', '**/*.mts', '**/*.cts',
|
|
9
|
-
],
|
|
10
7
|
languageOptions: {
|
|
11
8
|
parserOptions: {
|
|
12
9
|
projectService: true,
|
|
13
10
|
},
|
|
14
11
|
},
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
files: [
|
|
15
|
+
'**/*.ts', '**/*.tsx', '**/*.mts', '**/*.cts',
|
|
16
|
+
],
|
|
15
17
|
rules: {
|
|
16
18
|
'@typescript-eslint/no-deprecated': 'warn',
|
|
17
19
|
'@typescript-eslint/array-type': [
|