@slashnephy/eslint-config 0.1.0
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/common.js +9 -0
- package/dist/index.js +26 -0
- package/dist/prettier.js +14 -0
- package/dist/react.js +42 -0
- package/dist/typescript.js +99 -0
- package/package.json +62 -0
package/dist/common.js
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const path_1 = require("path");
|
|
4
|
+
const config = {
|
|
5
|
+
root: true,
|
|
6
|
+
overrides: [
|
|
7
|
+
{
|
|
8
|
+
files: ['**/*.ts'],
|
|
9
|
+
extends: [
|
|
10
|
+
(0, path_1.resolve)(__dirname, 'common.js'),
|
|
11
|
+
(0, path_1.resolve)(__dirname, 'typescript.js'),
|
|
12
|
+
(0, path_1.resolve)(__dirname, 'prettier.js'),
|
|
13
|
+
],
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
files: ['**/*.tsx'],
|
|
17
|
+
extends: [
|
|
18
|
+
(0, path_1.resolve)(__dirname, 'common.js'),
|
|
19
|
+
(0, path_1.resolve)(__dirname, 'typescript.js'),
|
|
20
|
+
(0, path_1.resolve)(__dirname, 'react.js'),
|
|
21
|
+
(0, path_1.resolve)(__dirname, 'prettier.js'),
|
|
22
|
+
],
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
};
|
|
26
|
+
module.exports = config;
|
package/dist/prettier.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const prettier = {
|
|
4
|
+
extends: [
|
|
5
|
+
'prettier',
|
|
6
|
+
],
|
|
7
|
+
rules: {
|
|
8
|
+
indent: ['error', 2, { 'SwitchCase': 1 }],
|
|
9
|
+
'linebreak-style': ['error', 'unix'],
|
|
10
|
+
quotes: ['error', 'single'],
|
|
11
|
+
semi: ['error', 'never'],
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
module.exports = prettier;
|
package/dist/react.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const react = {
|
|
4
|
+
extends: [
|
|
5
|
+
'next/core-web-vitals',
|
|
6
|
+
'plugin:css-import-order/recommended',
|
|
7
|
+
],
|
|
8
|
+
plugins: [
|
|
9
|
+
'css-import-order'
|
|
10
|
+
],
|
|
11
|
+
parserOptions: {
|
|
12
|
+
ecmaFeatures: {
|
|
13
|
+
jsx: true
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
settings: {
|
|
17
|
+
react: {
|
|
18
|
+
version: 'detect'
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
rules: {
|
|
22
|
+
'react/jsx-boolean-value': 'error',
|
|
23
|
+
'react/jsx-curly-brace-presence': 'error',
|
|
24
|
+
'react/self-closing-comp': [
|
|
25
|
+
'error',
|
|
26
|
+
{
|
|
27
|
+
'component': true,
|
|
28
|
+
'html': true
|
|
29
|
+
}
|
|
30
|
+
],
|
|
31
|
+
'react/jsx-pascal-case': 'error',
|
|
32
|
+
},
|
|
33
|
+
overrides: [
|
|
34
|
+
{
|
|
35
|
+
files: ['pages/**/*.{ts,tsx}'],
|
|
36
|
+
rules: {
|
|
37
|
+
'import/no-default-export': 'off'
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
],
|
|
41
|
+
};
|
|
42
|
+
module.exports = react;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const typescript = {
|
|
4
|
+
extends: [
|
|
5
|
+
'plugin:@typescript-eslint/recommended',
|
|
6
|
+
'plugin:@typescript-eslint/recommended-requiring-type-checking',
|
|
7
|
+
'plugin:import/typescript',
|
|
8
|
+
],
|
|
9
|
+
plugins: [
|
|
10
|
+
'@typescript-eslint',
|
|
11
|
+
'promise',
|
|
12
|
+
'unused-imports',
|
|
13
|
+
],
|
|
14
|
+
parser: '@typescript-eslint/parser',
|
|
15
|
+
parserOptions: {
|
|
16
|
+
sourceType: 'module',
|
|
17
|
+
ecmaVersion: 'latest',
|
|
18
|
+
project: './tsconfig.json',
|
|
19
|
+
},
|
|
20
|
+
env: {
|
|
21
|
+
node: true,
|
|
22
|
+
es2022: true,
|
|
23
|
+
browser: true
|
|
24
|
+
},
|
|
25
|
+
rules: {
|
|
26
|
+
'import/order': [
|
|
27
|
+
'warn',
|
|
28
|
+
{
|
|
29
|
+
'groups': [
|
|
30
|
+
'builtin',
|
|
31
|
+
'external',
|
|
32
|
+
['parent', 'sibling', 'index'],
|
|
33
|
+
'object',
|
|
34
|
+
'type',
|
|
35
|
+
'unknown'
|
|
36
|
+
],
|
|
37
|
+
'newlines-between': 'always',
|
|
38
|
+
'alphabetize': {
|
|
39
|
+
'order': 'asc',
|
|
40
|
+
'caseInsensitive': true
|
|
41
|
+
},
|
|
42
|
+
'pathGroups': [
|
|
43
|
+
{
|
|
44
|
+
'pattern': '**.css',
|
|
45
|
+
'group': 'type',
|
|
46
|
+
'position': 'after'
|
|
47
|
+
}
|
|
48
|
+
],
|
|
49
|
+
'warnOnUnassignedImports': true
|
|
50
|
+
}
|
|
51
|
+
],
|
|
52
|
+
'unused-imports/no-unused-imports': 'error',
|
|
53
|
+
'@typescript-eslint/consistent-type-imports': [
|
|
54
|
+
'error',
|
|
55
|
+
{
|
|
56
|
+
'prefer': 'type-imports'
|
|
57
|
+
}
|
|
58
|
+
],
|
|
59
|
+
'@typescript-eslint/no-unused-vars': 'off',
|
|
60
|
+
'unused-imports/no-unused-vars': [
|
|
61
|
+
'warn',
|
|
62
|
+
{
|
|
63
|
+
'vars': 'all',
|
|
64
|
+
'varsIgnorePattern': '^_',
|
|
65
|
+
'args': 'after-used',
|
|
66
|
+
'argsIgnorePattern': '^_'
|
|
67
|
+
}
|
|
68
|
+
],
|
|
69
|
+
'import/no-default-export': 'error',
|
|
70
|
+
'prefer-arrow-callback': 'error',
|
|
71
|
+
'func-style': [2, 'declaration', { 'allowArrowFunctions': true }],
|
|
72
|
+
'curly': 'error',
|
|
73
|
+
'prefer-template': 'error',
|
|
74
|
+
eqeqeq: 'error',
|
|
75
|
+
strict: ['error', 'global'],
|
|
76
|
+
'@typescript-eslint/array-type': 'error',
|
|
77
|
+
'@typescript-eslint/consistent-type-assertions': 'error',
|
|
78
|
+
'@typescript-eslint/no-floating-promises': 'warn',
|
|
79
|
+
'@typescript-eslint/no-require-imports': 'error',
|
|
80
|
+
'@typescript-eslint/promise-function-async': 'error',
|
|
81
|
+
'@typescript-eslint/no-implied-eval': 'error',
|
|
82
|
+
'react/react-in-jsx-scope': 'off',
|
|
83
|
+
'@typescript-eslint/restrict-template-expressions': 'off',
|
|
84
|
+
'@typescript-eslint/unbound-method': 'off',
|
|
85
|
+
'@typescript-eslint/no-unsafe-assignment': 'off',
|
|
86
|
+
'@typescript-eslint/no-unsafe-return': 'off',
|
|
87
|
+
'@typescript-eslint/no-misused-promises': 'off',
|
|
88
|
+
'@typescript-eslint/explicit-member-accessibility': 'error'
|
|
89
|
+
},
|
|
90
|
+
overrides: [
|
|
91
|
+
{
|
|
92
|
+
files: ['**/webpack.config.ts'],
|
|
93
|
+
rules: {
|
|
94
|
+
'import/no-default-export': 'off'
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
],
|
|
98
|
+
};
|
|
99
|
+
module.exports = typescript;
|
package/package.json
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@slashnephy/eslint-config",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"repository": {
|
|
5
|
+
"url": "https://github.com/SlashNephy/.github",
|
|
6
|
+
"directory": "env/eslint"
|
|
7
|
+
},
|
|
8
|
+
"author": "SlashNephy <spica@starry.blue>",
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"main": "dist/index.js",
|
|
11
|
+
"files": [
|
|
12
|
+
"package.json",
|
|
13
|
+
"dist/*.js"
|
|
14
|
+
],
|
|
15
|
+
"publishConfig": {
|
|
16
|
+
"access": "public"
|
|
17
|
+
},
|
|
18
|
+
"scripts": {
|
|
19
|
+
"build": "tsc",
|
|
20
|
+
"lint": "concurrently -n lint: 'yarn:lint:*'",
|
|
21
|
+
"lint:eslint": "eslint .",
|
|
22
|
+
"lint:prettier": "prettier --check .",
|
|
23
|
+
"format": "concurrently -n format: 'yarn:format:*'",
|
|
24
|
+
"format:eslint": "yarn lint:eslint --fix",
|
|
25
|
+
"format:prettier": "yarn lint:prettier --write",
|
|
26
|
+
"clean": "rm -rf dist/*",
|
|
27
|
+
"publish": "yarn clean && yarn build && yarn npm publish"
|
|
28
|
+
},
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"@typescript-eslint/eslint-plugin": "5.27.1",
|
|
31
|
+
"@typescript-eslint/parser": "5.27.1",
|
|
32
|
+
"eslint-config-next": "12.1.6",
|
|
33
|
+
"eslint-config-prettier": "8.5.0",
|
|
34
|
+
"eslint-import-resolver-typescript": "2.7.1",
|
|
35
|
+
"eslint-plugin-css-import-order": "1.1.0",
|
|
36
|
+
"eslint-plugin-import": "2.26.0",
|
|
37
|
+
"eslint-plugin-promise": "6.0.0",
|
|
38
|
+
"eslint-plugin-react": "7.30.0",
|
|
39
|
+
"eslint-plugin-react-hooks": "4.5.0",
|
|
40
|
+
"eslint-plugin-unused-imports": "2.0.0"
|
|
41
|
+
},
|
|
42
|
+
"peerDependencies": {
|
|
43
|
+
"eslint": "^8",
|
|
44
|
+
"prettier": "^2",
|
|
45
|
+
"typescript": "^4"
|
|
46
|
+
},
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"@types/eslint": "8.4.3",
|
|
49
|
+
"@types/node": "17.0.41",
|
|
50
|
+
"@types/prettier": "2.6.3",
|
|
51
|
+
"concurrently": "7.2.1",
|
|
52
|
+
"eslint": "8.17.0",
|
|
53
|
+
"prettier": "2.6.2",
|
|
54
|
+
"typescript": "4.7.3"
|
|
55
|
+
},
|
|
56
|
+
"packageManager": "yarn@3.2.1",
|
|
57
|
+
"eslintConfig": {
|
|
58
|
+
"extends": [
|
|
59
|
+
"./dist/eslintrc.js"
|
|
60
|
+
]
|
|
61
|
+
}
|
|
62
|
+
}
|