@slashnephy/eslint-config 1.0.2 → 1.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/dist/base/javascript.js +11 -1
- package/dist/base/typescript.js +13 -0
- package/dist/framework/next.js.js +6 -3
- package/dist/framework/react.js +2 -4
- package/dist/framework/vite.js +8 -0
- package/dist/index.js +29 -21
- package/dist/presets/a11y.js +28 -0
- package/package.json +8 -3
- package/dist/patch.js +0 -3
- /package/dist/{base → presets}/style.js +0 -0
package/dist/base/javascript.js
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const eslint_config_standard_1 = __importDefault(require("eslint-config-standard"));
|
|
3
7
|
module.exports = {
|
|
4
8
|
extends: [
|
|
5
9
|
'plugin:eslint-comments/recommended',
|
|
@@ -7,7 +11,7 @@ module.exports = {
|
|
|
7
11
|
'plugin:import/recommended',
|
|
8
12
|
'plugin:xss/recommended',
|
|
9
13
|
],
|
|
10
|
-
plugins: ['promise', 'unused-imports'],
|
|
14
|
+
plugins: ['import', 'promise', 'n', 'unused-imports'],
|
|
11
15
|
env: {
|
|
12
16
|
node: true,
|
|
13
17
|
es2022: true,
|
|
@@ -15,7 +19,13 @@ module.exports = {
|
|
|
15
19
|
parserOptions: {
|
|
16
20
|
ecmaVersion: 'latest',
|
|
17
21
|
},
|
|
22
|
+
globals: {
|
|
23
|
+
document: 'readonly',
|
|
24
|
+
navigator: 'readonly',
|
|
25
|
+
window: 'readonly',
|
|
26
|
+
},
|
|
18
27
|
rules: {
|
|
28
|
+
...eslint_config_standard_1.default.rules,
|
|
19
29
|
'eslint-comments/no-unused-disable': 'error',
|
|
20
30
|
'import/no-default-export': 'error',
|
|
21
31
|
'prefer-arrow-callback': 'error',
|
package/dist/base/typescript.js
CHANGED
|
@@ -17,6 +17,19 @@ module.exports = {
|
|
|
17
17
|
project: './tsconfig.json',
|
|
18
18
|
warnOnUnsupportedTypeScriptVersion: true,
|
|
19
19
|
},
|
|
20
|
+
settings: {
|
|
21
|
+
'import/parsers': {
|
|
22
|
+
'@typescript-eslint/parser': ['.ts', '.mts', '.cts', '.tsx', '.d.ts'],
|
|
23
|
+
},
|
|
24
|
+
'import/resolver': {
|
|
25
|
+
node: {
|
|
26
|
+
extensions: ['.js', '.jsx', '.ts', '.tsx'],
|
|
27
|
+
},
|
|
28
|
+
typescript: {
|
|
29
|
+
alwaysTryTypes: true,
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
},
|
|
20
33
|
rules: {
|
|
21
34
|
'@typescript-eslint/consistent-type-definitions': ['error', 'type'],
|
|
22
35
|
'@typescript-eslint/consistent-type-exports': [
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const eslint_config_next_1 = __importDefault(require("eslint-config-next"));
|
|
3
7
|
module.exports = {
|
|
4
|
-
extends: [
|
|
5
|
-
'next/core-web-vitals',
|
|
6
|
-
],
|
|
8
|
+
extends: ['plugin:@next/next/recommended'],
|
|
7
9
|
rules: {
|
|
10
|
+
...eslint_config_next_1.default.rules,
|
|
8
11
|
'import/no-default-export': 'off',
|
|
9
12
|
},
|
|
10
13
|
};
|
package/dist/framework/react.js
CHANGED
|
@@ -2,13 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
module.exports = {
|
|
4
4
|
extends: [
|
|
5
|
-
'airbnb/hooks',
|
|
6
5
|
'plugin:react/recommended',
|
|
7
6
|
'plugin:react/jsx-runtime',
|
|
8
7
|
'plugin:css-import-order/recommended',
|
|
9
|
-
'plugin:jsx-a11y/recommended',
|
|
10
8
|
],
|
|
11
|
-
plugins: ['
|
|
9
|
+
plugins: ['react-hooks', 'css-import-order'],
|
|
12
10
|
parserOptions: {
|
|
13
11
|
ecmaFeatures: {
|
|
14
12
|
jsx: true,
|
|
@@ -18,6 +16,7 @@ module.exports = {
|
|
|
18
16
|
},
|
|
19
17
|
env: {
|
|
20
18
|
browser: true,
|
|
19
|
+
node: true,
|
|
21
20
|
},
|
|
22
21
|
settings: {
|
|
23
22
|
react: {
|
|
@@ -64,7 +63,6 @@ module.exports = {
|
|
|
64
63
|
'react/jsx-props-no-spreading': 'off',
|
|
65
64
|
'react/jsx-no-useless-fragment': 'off',
|
|
66
65
|
'react/require-default-props': 'off',
|
|
67
|
-
'react-refresh/only-export-components': 'warn',
|
|
68
66
|
},
|
|
69
67
|
overrides: [
|
|
70
68
|
{
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@ const path_1 = require("path");
|
|
|
4
4
|
require("@rushstack/eslint-patch/modern-module-resolution.js");
|
|
5
5
|
module.exports = {
|
|
6
6
|
root: true,
|
|
7
|
-
extends: ['eslint:recommended'
|
|
7
|
+
extends: ['eslint:recommended'],
|
|
8
8
|
overrides: [
|
|
9
9
|
{
|
|
10
10
|
files: '**/*.{js,mjs,cjs,jsx,ts,mts,cts,tsx}',
|
|
@@ -15,42 +15,42 @@ module.exports = {
|
|
|
15
15
|
extends: [(0, path_1.resolve)(__dirname, 'base/typescript.js')],
|
|
16
16
|
},
|
|
17
17
|
{
|
|
18
|
-
files:
|
|
19
|
-
|
|
20
|
-
'**/test/**/*.{js,mjs,cjs,jsx,ts,mts,cts,tsx}',
|
|
21
|
-
],
|
|
22
|
-
extends: [
|
|
23
|
-
(0, path_1.resolve)(__dirname, 'framework/jest.js'),
|
|
24
|
-
(0, path_1.resolve)(__dirname, 'framework/vitest.js'),
|
|
25
|
-
],
|
|
18
|
+
files: '**/*.json',
|
|
19
|
+
extends: (0, path_1.resolve)(__dirname, 'base/json.js'),
|
|
26
20
|
},
|
|
27
21
|
{
|
|
28
|
-
files: '**/*.{
|
|
29
|
-
extends: (0, path_1.resolve)(__dirname, '
|
|
22
|
+
files: '**/*.{yml,yaml}',
|
|
23
|
+
extends: (0, path_1.resolve)(__dirname, 'base/yaml.js'),
|
|
30
24
|
},
|
|
31
25
|
{
|
|
32
26
|
files: '**/*.{jsx,tsx}',
|
|
33
|
-
extends: (0, path_1.resolve)(__dirname, 'framework/
|
|
27
|
+
extends: (0, path_1.resolve)(__dirname, 'framework/react.js'),
|
|
34
28
|
},
|
|
35
29
|
{
|
|
36
30
|
files: '**/{pages,app}/**/*.{js,mjs,cjs,jsx,ts,mts,cts,tsx}',
|
|
37
31
|
extends: (0, path_1.resolve)(__dirname, 'framework/next.js.js'),
|
|
38
32
|
},
|
|
39
33
|
{
|
|
40
|
-
files: '
|
|
41
|
-
extends: (0, path_1.resolve)(__dirname, '
|
|
34
|
+
files: '**/src/**/*.{js,mjs,cjs,jsx,ts,mts,cts,tsx}',
|
|
35
|
+
extends: (0, path_1.resolve)(__dirname, 'framework/vite.js'),
|
|
42
36
|
},
|
|
43
37
|
{
|
|
44
|
-
files: '**/*.{
|
|
45
|
-
extends: (0, path_1.resolve)(__dirname, '
|
|
38
|
+
files: '**/*.{jsx,tsx}',
|
|
39
|
+
extends: (0, path_1.resolve)(__dirname, 'framework/emotion.js'),
|
|
46
40
|
},
|
|
47
41
|
{
|
|
48
|
-
files:
|
|
49
|
-
|
|
42
|
+
files: [
|
|
43
|
+
'**/*.test.{js,mjs,cjs,jsx,ts,mts,cts,tsx}',
|
|
44
|
+
'**/test/**/*.{js,mjs,cjs,jsx,ts,mts,cts,tsx}',
|
|
45
|
+
],
|
|
46
|
+
extends: [
|
|
47
|
+
(0, path_1.resolve)(__dirname, 'framework/jest.js'),
|
|
48
|
+
(0, path_1.resolve)(__dirname, 'framework/vitest.js'),
|
|
49
|
+
],
|
|
50
50
|
},
|
|
51
51
|
{
|
|
52
|
-
files: '**/*.
|
|
53
|
-
extends: (0, path_1.resolve)(__dirname, 'presets/
|
|
52
|
+
files: '**/*.{jsx,tsx}',
|
|
53
|
+
extends: (0, path_1.resolve)(__dirname, 'presets/a11y.js'),
|
|
54
54
|
},
|
|
55
55
|
{
|
|
56
56
|
files: [
|
|
@@ -63,9 +63,17 @@ module.exports = {
|
|
|
63
63
|
files: '**/{webpack,rollup,vite}.config.{js,mjs,cjs,ts,mts,cts}',
|
|
64
64
|
extends: (0, path_1.resolve)(__dirname, 'presets/config.js'),
|
|
65
65
|
},
|
|
66
|
+
{
|
|
67
|
+
files: '**/package.json',
|
|
68
|
+
extends: (0, path_1.resolve)(__dirname, 'presets/package.json.js'),
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
files: '**/*.user.js',
|
|
72
|
+
extends: (0, path_1.resolve)(__dirname, 'presets/userscript.js'),
|
|
73
|
+
},
|
|
66
74
|
{
|
|
67
75
|
files: '**/*',
|
|
68
|
-
extends: (0, path_1.resolve)(__dirname, '
|
|
76
|
+
extends: (0, path_1.resolve)(__dirname, 'presets/style.js'),
|
|
69
77
|
},
|
|
70
78
|
],
|
|
71
79
|
ignorePatterns: ['**/node_modules/**'],
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const react_a11y_1 = __importDefault(require("eslint-config-airbnb/rules/react-a11y"));
|
|
7
|
+
module.exports = {
|
|
8
|
+
extends: ['plugin:jsx-a11y/recommended'],
|
|
9
|
+
plugins: ['jsx-a11y'],
|
|
10
|
+
parserOptions: {
|
|
11
|
+
ecmaFeatures: {
|
|
12
|
+
jsx: true,
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
rules: {
|
|
16
|
+
...react_a11y_1.default.rules,
|
|
17
|
+
'jsx-a11y/alt-text': [
|
|
18
|
+
'warn',
|
|
19
|
+
{
|
|
20
|
+
elements: ['img', 'object', 'area', 'input[type="image"]'],
|
|
21
|
+
img: ['Image'],
|
|
22
|
+
object: [],
|
|
23
|
+
area: [],
|
|
24
|
+
'input[type="image"]': [],
|
|
25
|
+
},
|
|
26
|
+
],
|
|
27
|
+
},
|
|
28
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@slashnephy/eslint-config",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"author": "SlashNephy <spica@starry.blue> (https://spica.starry.blue/)",
|
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@emotion/eslint-plugin": "11.11.0",
|
|
34
|
+
"@next/eslint-plugin-next": "13.4.12",
|
|
34
35
|
"@rushstack/eslint-patch": "1.3.2",
|
|
35
36
|
"@typescript-eslint/eslint-plugin": "6.2.0",
|
|
36
37
|
"@typescript-eslint/parser": "6.2.0",
|
|
@@ -38,6 +39,7 @@
|
|
|
38
39
|
"eslint-config-next": "13.4.12",
|
|
39
40
|
"eslint-config-prettier": "8.9.0",
|
|
40
41
|
"eslint-config-standard": "17.1.0",
|
|
42
|
+
"eslint-import-resolver-node": "0.3.7",
|
|
41
43
|
"eslint-import-resolver-typescript": "3.5.5",
|
|
42
44
|
"eslint-plugin-css-import-order": "1.1.0",
|
|
43
45
|
"eslint-plugin-css-reorder": "0.5.1",
|
|
@@ -59,7 +61,7 @@
|
|
|
59
61
|
"eslint-plugin-react-refresh": "0.4.3",
|
|
60
62
|
"eslint-plugin-storybook": "0.6.12",
|
|
61
63
|
"eslint-plugin-tsdoc": "0.2.17",
|
|
62
|
-
"eslint-plugin-unused-imports": "
|
|
64
|
+
"eslint-plugin-unused-imports": "3.0.0",
|
|
63
65
|
"eslint-plugin-userscripts": "0.3.0",
|
|
64
66
|
"eslint-plugin-vitest": "0.2.2",
|
|
65
67
|
"eslint-plugin-xss": "0.1.12",
|
|
@@ -71,7 +73,7 @@
|
|
|
71
73
|
"eslint": "^8"
|
|
72
74
|
},
|
|
73
75
|
"devDependencies": {
|
|
74
|
-
"@slashnephy/prettier-config": "0.1.
|
|
76
|
+
"@slashnephy/prettier-config": "0.1.26",
|
|
75
77
|
"@types/eslint": "8.44.1",
|
|
76
78
|
"@types/node": "20.4.5",
|
|
77
79
|
"concurrently": "8.2.0",
|
|
@@ -80,6 +82,9 @@
|
|
|
80
82
|
"ts-node": "10.9.1"
|
|
81
83
|
},
|
|
82
84
|
"packageManager": "yarn@3.6.1",
|
|
85
|
+
"eslintConfig": {
|
|
86
|
+
"extends": "./dist"
|
|
87
|
+
},
|
|
83
88
|
"keywords": [
|
|
84
89
|
"eslint",
|
|
85
90
|
"eslintconfig"
|
package/dist/patch.js
DELETED
|
File without changes
|