@kirill.konshin/eslint-config-next-custom 0.3.0 → 0.3.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 +22 -18
- package/index.js +9 -4
- package/package.json +15 -12
- package/.editorconfig +0 -17
- package/.yarnrc.yml +0 -1
package/CHANGELOG.md
ADDED
package/README.md
CHANGED
|
@@ -18,14 +18,14 @@ import customConfig from '@kirill.konshin/eslint-config-next-custom';
|
|
|
18
18
|
const gitignorePath = resolve(dirname(fileURLToPath(import.meta.url)), '.prettierignore'); // <----- !!!
|
|
19
19
|
|
|
20
20
|
const config = [
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
...customConfig,
|
|
22
|
+
{
|
|
23
|
+
name: 'Custom rules',
|
|
24
|
+
rules: {
|
|
25
|
+
// overrides
|
|
26
|
+
},
|
|
26
27
|
},
|
|
27
|
-
|
|
28
|
-
includeIgnoreFile(gitignorePath),
|
|
28
|
+
includeIgnoreFile(gitignorePath),
|
|
29
29
|
];
|
|
30
30
|
|
|
31
31
|
export default config;
|
|
@@ -40,27 +40,31 @@ export default {
|
|
|
40
40
|
...config,
|
|
41
41
|
// overrides
|
|
42
42
|
};
|
|
43
|
-
|
|
44
43
|
```
|
|
45
44
|
|
|
46
45
|
`package.json`:
|
|
47
46
|
|
|
48
47
|
```json5
|
|
49
48
|
{
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
49
|
+
scripts: {
|
|
50
|
+
eslint: 'DEBUG=eslint:eslint eslint --cache --cache-location node_modules/.cache/eslint --fix',
|
|
51
|
+
prettier: 'prettier --write',
|
|
52
|
+
'lint:all': 'yarn eslint . && yarn prettier .',
|
|
53
|
+
},
|
|
55
54
|
}
|
|
56
55
|
```
|
|
57
56
|
|
|
57
|
+
IDEA settings:
|
|
58
|
+
|
|
59
|
+
- Eslint: `**/*.{js,jsx,ts,tsx,cjs,cts,mjs,mts,htm,html,md,mdx,vue}`
|
|
60
|
+
- Prettier: `{**/*}.{js,jsx,ts,tsx,cjs,cts,mjs,mts,htm,html,md,mdx,css,scss,sass,less,yml,yaml,json}`
|
|
61
|
+
|
|
58
62
|
## Lint Staged
|
|
59
63
|
|
|
60
64
|
```json5
|
|
61
65
|
{
|
|
62
|
-
|
|
63
|
-
|
|
66
|
+
'*.{js,jsx,ts,tsx,cjs,cts,mjs,mts,htm,html,md,mdx,vue}': 'yarn eslint',
|
|
67
|
+
'*.{js,jsx,ts,tsx,cjs,cts,mjs,mts,htm,html,md,mdx,css,scss,sass,less,yml,yaml,json}': 'yarn prettier',
|
|
64
68
|
}
|
|
65
69
|
```
|
|
66
70
|
|
|
@@ -68,9 +72,9 @@ export default {
|
|
|
68
72
|
|
|
69
73
|
```json5
|
|
70
74
|
{
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
75
|
+
scripts: {
|
|
76
|
+
prepare: 'husky install',
|
|
77
|
+
},
|
|
74
78
|
}
|
|
75
79
|
```
|
|
76
80
|
|
package/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// @see https://blog.linotte.dev/eslint-9-next-js-935c2b6d0371
|
|
2
|
-
import {dirname} from 'node:path';
|
|
3
|
-
import {fileURLToPath} from 'node:url';
|
|
2
|
+
import { dirname } from 'node:path';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
4
4
|
|
|
5
5
|
import js from '@eslint/js';
|
|
6
|
-
import {FlatCompat} from '@eslint/eslintrc';
|
|
7
|
-
import {fixupConfigRules} from '@eslint/compat';
|
|
6
|
+
import { FlatCompat } from '@eslint/eslintrc';
|
|
7
|
+
import { fixupConfigRules } from '@eslint/compat';
|
|
8
8
|
import prettierConfigRecommended from 'eslint-config-prettier';
|
|
9
9
|
import globals from 'globals';
|
|
10
10
|
|
|
@@ -46,6 +46,11 @@ const index = [
|
|
|
46
46
|
'@typescript-eslint/no-explicit-any': 'off',
|
|
47
47
|
'@typescript-eslint/no-require-imports': 'off',
|
|
48
48
|
'@typescript-eslint/no-unused-vars': 'off',
|
|
49
|
+
'import/named': 'off',
|
|
50
|
+
'import/no-default-export': 'off',
|
|
51
|
+
'import/no-anonymous-default-export': 'off',
|
|
52
|
+
'import/no-unresolved': 'off',
|
|
53
|
+
'import/no-webpack-loader-syntax': 'off',
|
|
49
54
|
},
|
|
50
55
|
},
|
|
51
56
|
];
|
package/package.json
CHANGED
|
@@ -1,23 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kirill.konshin/eslint-config-next-custom",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
|
+
"type": "module",
|
|
4
5
|
"main": "index.js",
|
|
5
6
|
"module": "index.js",
|
|
6
|
-
"
|
|
7
|
+
"exports": {
|
|
8
|
+
".": "./index.js",
|
|
9
|
+
"./prettier": "./prettier.js"
|
|
10
|
+
},
|
|
7
11
|
"dependencies": {
|
|
8
|
-
"@eslint/compat": "^1.2.
|
|
12
|
+
"@eslint/compat": "^1.2.5",
|
|
9
13
|
"@eslint/eslintrc": "^3.2.0",
|
|
10
|
-
"@eslint/js": "^9.
|
|
11
|
-
"@next/eslint-plugin-next": "^15.1.
|
|
12
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
13
|
-
"@typescript-eslint/parser": "^8.
|
|
14
|
-
"eslint-config-next": "^15.1.
|
|
15
|
-
"eslint-config-prettier": "^
|
|
14
|
+
"@eslint/js": "^9.18.0",
|
|
15
|
+
"@next/eslint-plugin-next": "^15.1.6",
|
|
16
|
+
"@typescript-eslint/eslint-plugin": "^8.21.0",
|
|
17
|
+
"@typescript-eslint/parser": "^8.21.0",
|
|
18
|
+
"eslint-config-next": "^15.1.6",
|
|
19
|
+
"eslint-config-prettier": "^10.0.1",
|
|
16
20
|
"eslint-plugin-react-hooks": "^5.1.0",
|
|
17
21
|
"globals": "^15.14.0"
|
|
18
22
|
},
|
|
19
23
|
"devDependencies": {
|
|
20
|
-
"typescript": "^5.7.
|
|
24
|
+
"typescript": "^5.7.3"
|
|
21
25
|
},
|
|
22
26
|
"peerDependencies": {
|
|
23
27
|
"next": "^15"
|
|
@@ -27,6 +31,5 @@
|
|
|
27
31
|
},
|
|
28
32
|
"author": "Kirill Konshin <kirill@konshin.org> (https://konshin.org)",
|
|
29
33
|
"license": "MIT",
|
|
30
|
-
"description": ""
|
|
31
|
-
"packageManager": "yarn@4.5.1"
|
|
34
|
+
"description": ""
|
|
32
35
|
}
|
package/.editorconfig
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
root = true
|
|
2
|
-
|
|
3
|
-
[*]
|
|
4
|
-
indent_style = space
|
|
5
|
-
end_of_line = lf
|
|
6
|
-
charset = utf-8
|
|
7
|
-
trim_trailing_whitespace = true
|
|
8
|
-
insert_final_newline = false
|
|
9
|
-
|
|
10
|
-
[*.{mjs,js,jsx,ts,tsx,htm,html,md,mdx}]
|
|
11
|
-
indent_size = 4
|
|
12
|
-
|
|
13
|
-
[*.{css,sass,scss,yml,json}]
|
|
14
|
-
indent_size = 2
|
|
15
|
-
|
|
16
|
-
[Makefile]
|
|
17
|
-
indent_style = tab
|
package/.yarnrc.yml
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
yarnPath: .yarn/releases/yarn-4.5.1.cjs
|