@mscharley/eslint-config 3.1.1 → 3.1.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 +13 -4
- package/package.json +2 -6
- package/partials/style.js +8 -10
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -14,7 +14,7 @@ This is a preset for eslint for use with TypeScript or JavaScript projects.
|
|
|
14
14
|
## Installation
|
|
15
15
|
|
|
16
16
|
```console
|
|
17
|
-
$ npm install --save-dev @mscharley/eslint-config
|
|
17
|
+
$ npm install --save-dev @mscharley/eslint-config
|
|
18
18
|
```
|
|
19
19
|
|
|
20
20
|
## Usage
|
|
@@ -31,9 +31,18 @@ module.exports = {
|
|
|
31
31
|
};
|
|
32
32
|
```
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
### Notes on Prettier
|
|
35
|
+
|
|
36
|
+
If using Prettier to format files other than TypeScript and JavaScript files then you should ignore all TS/JS files to prevent ESLint and Prettier from fighting with each other.
|
|
37
|
+
|
|
38
|
+
```ignore
|
|
39
|
+
# .prettierignore
|
|
40
|
+
**/*.cts
|
|
41
|
+
**/*.mts
|
|
42
|
+
**/*.ts
|
|
43
|
+
**/*.cjs
|
|
44
|
+
**/*.mjs
|
|
45
|
+
**/*.js
|
|
37
46
|
```
|
|
38
47
|
|
|
39
48
|
## Extras
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mscharley/eslint-config",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.2",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"provenance": true
|
|
6
6
|
},
|
|
@@ -27,21 +27,17 @@
|
|
|
27
27
|
},
|
|
28
28
|
"homepage": "https://github.com/mscharley/node-presets#readme",
|
|
29
29
|
"peerDependencies": {
|
|
30
|
-
"@mscharley/prettier-config": "3.0.5",
|
|
31
30
|
"@stylistic/eslint-plugin": "^1.7.0",
|
|
32
31
|
"@typescript-eslint/eslint-plugin": "^7.4.0",
|
|
33
32
|
"@typescript-eslint/parser": "^7.4.0",
|
|
34
33
|
"eslint": "^8.57.0",
|
|
35
|
-
"eslint-config-prettier": "^9.1.0",
|
|
36
34
|
"eslint-import-resolver-typescript": "^3.6.1",
|
|
37
35
|
"eslint-plugin-deprecation": "^2.0.0",
|
|
38
36
|
"eslint-plugin-import": "^2.29.1",
|
|
39
37
|
"eslint-plugin-jest": "^27.9.0",
|
|
40
|
-
"eslint-plugin-n": "^
|
|
41
|
-
"eslint-plugin-prettier": "^5.1.3",
|
|
38
|
+
"eslint-plugin-n": "^16.6.2",
|
|
42
39
|
"eslint-plugin-react": "^7.34.1",
|
|
43
40
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
44
|
-
"prettier": "^3.2.5",
|
|
45
41
|
"typescript": "^5.4.3"
|
|
46
42
|
}
|
|
47
43
|
}
|
package/partials/style.js
CHANGED
|
@@ -1,31 +1,29 @@
|
|
|
1
1
|
const stylistic = require('@stylistic/eslint-plugin');
|
|
2
2
|
|
|
3
|
-
const prettierConfig = require('@mscharley/prettier-config');
|
|
4
|
-
const TAB_WIDTH = 2;
|
|
5
3
|
const customized = stylistic.configs.customize({
|
|
6
4
|
flat: false,
|
|
7
|
-
indent:
|
|
8
|
-
quotes:
|
|
9
|
-
semi:
|
|
5
|
+
indent: 'tab',
|
|
6
|
+
quotes: 'single',
|
|
7
|
+
semi: true,
|
|
10
8
|
jsx: true,
|
|
11
9
|
commaDangle: 'always-multiline',
|
|
12
|
-
quoteProps:
|
|
13
|
-
arrowParens:
|
|
10
|
+
quoteProps: 'always',
|
|
11
|
+
arrowParens: true,
|
|
14
12
|
braceStyle: '1tbs',
|
|
15
13
|
});
|
|
16
14
|
|
|
17
15
|
module.exports = {
|
|
18
|
-
plugins: ['@stylistic'
|
|
16
|
+
plugins: ['@stylistic'],
|
|
19
17
|
extends: ['plugin:@stylistic/disable-legacy'],
|
|
20
18
|
rules: {
|
|
21
|
-
'prettier/prettier': ['error', prettierConfig],
|
|
22
19
|
...customized.rules,
|
|
23
20
|
'@stylistic/generator-star-spacing': ['error', 'after'],
|
|
24
|
-
'@stylistic/linebreak-style': ['error',
|
|
21
|
+
'@stylistic/linebreak-style': ['error', 'unix'],
|
|
25
22
|
'@stylistic/quotes': [
|
|
26
23
|
'error',
|
|
27
24
|
customized.rules['@stylistic/quotes'][1],
|
|
28
25
|
{ avoidEscape: true, allowTemplateLiterals: false },
|
|
29
26
|
],
|
|
27
|
+
'@stylistic/quote-props': ['error', 'consistent-as-needed'],
|
|
30
28
|
},
|
|
31
29
|
};
|