@mscharley/eslint-config 4.0.1 → 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 +7 -0
- package/README.md +9 -28
- package/package.json +1 -1
- package/rules/testing.js +7 -0
package/CHANGELOG.md
CHANGED
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
|
];
|