@siberiacancode/eslint 2.0.0 → 2.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/index.d.ts +18 -18
- package/index.js +51 -32
- package/package.json +26 -17
package/index.d.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
declare module '@siberiacancode/eslint' {
|
|
2
|
-
declare type Eslint = (
|
|
3
|
-
options?: import('@antfu/eslint-config').OptionsConfig & {
|
|
4
|
-
'jsx-a11y': boolean;
|
|
5
|
-
} & import('@antfu/eslint-config').TypedFlatConfigItem,
|
|
6
|
-
...userConfigs: import('@antfu/eslint-config').Awaitable<
|
|
7
|
-
| import('@antfu/eslint-config').TypedFlatConfigItem
|
|
8
|
-
| import('@antfu/eslint-config').TypedFlatConfigItem[]
|
|
9
|
-
| import('@antfu/eslint-config').FlatConfigComposer<any, any>
|
|
10
|
-
| Linter.Config[]
|
|
11
|
-
>[]
|
|
12
|
-
) => import('@antfu/eslint-config').FlatConfigComposer<
|
|
13
|
-
import('@antfu/eslint-config').TypedFlatConfigItem,
|
|
14
|
-
import('@antfu/eslint-config').ConfigNames
|
|
15
|
-
>;
|
|
16
|
-
|
|
17
|
-
export const eslint: Eslint;
|
|
18
|
-
}
|
|
1
|
+
declare module '@siberiacancode/eslint' {
|
|
2
|
+
declare type Eslint = (
|
|
3
|
+
options?: import('@antfu/eslint-config').OptionsConfig & {
|
|
4
|
+
'jsx-a11y': boolean;
|
|
5
|
+
} & import('@antfu/eslint-config').TypedFlatConfigItem,
|
|
6
|
+
...userConfigs: import('@antfu/eslint-config').Awaitable<
|
|
7
|
+
| import('@antfu/eslint-config').TypedFlatConfigItem
|
|
8
|
+
| import('@antfu/eslint-config').TypedFlatConfigItem[]
|
|
9
|
+
| import('@antfu/eslint-config').FlatConfigComposer<any, any>
|
|
10
|
+
| Linter.Config[]
|
|
11
|
+
>[]
|
|
12
|
+
) => import('@antfu/eslint-config').FlatConfigComposer<
|
|
13
|
+
import('@antfu/eslint-config').TypedFlatConfigItem,
|
|
14
|
+
import('@antfu/eslint-config').ConfigNames
|
|
15
|
+
>;
|
|
16
|
+
|
|
17
|
+
export const eslint: Eslint;
|
|
18
|
+
}
|
package/index.js
CHANGED
|
@@ -1,27 +1,17 @@
|
|
|
1
1
|
import antfu from '@antfu/eslint-config';
|
|
2
|
+
import pluginJsxA11y from 'eslint-plugin-jsx-a11y';
|
|
2
3
|
import pluginReact from 'eslint-plugin-react';
|
|
3
4
|
import simpleImportSort from 'eslint-plugin-simple-import-sort';
|
|
4
|
-
import pluginJsxA11y from 'eslint-plugin-jsx-a11y';
|
|
5
5
|
|
|
6
6
|
/** @type {import('@siberiacancode/eslint').Eslint} */
|
|
7
7
|
export const eslint = (...args) =>
|
|
8
8
|
antfu(
|
|
9
9
|
{
|
|
10
|
-
|
|
11
|
-
typescript: true,
|
|
12
|
-
jsx: true
|
|
10
|
+
typescript: true
|
|
13
11
|
},
|
|
14
12
|
{
|
|
15
13
|
name: 'siberiacancode/rewrite',
|
|
16
14
|
rules: {
|
|
17
|
-
'style/semi': 'off',
|
|
18
|
-
'style/jsx-one-expression-per-line': 'off',
|
|
19
|
-
'style/member-delimiter-style': 'off',
|
|
20
|
-
'style/jsx-quotes': ['error', 'prefer-single'],
|
|
21
|
-
'style/comma-dangle': 'off',
|
|
22
|
-
'style/arrow-parens': 'off',
|
|
23
|
-
'style/quote-props': 'off',
|
|
24
|
-
|
|
25
15
|
'antfu/top-level-function': 'off',
|
|
26
16
|
'antfu/if-newline': 'off',
|
|
27
17
|
'antfu/curly': 'off',
|
|
@@ -33,26 +23,7 @@ export const eslint = (...args) =>
|
|
|
33
23
|
'no-console': 'warn'
|
|
34
24
|
}
|
|
35
25
|
},
|
|
36
|
-
|
|
37
|
-
name: 'siberiacancode/react',
|
|
38
|
-
plugins: {
|
|
39
|
-
'plugin-react': pluginReact
|
|
40
|
-
},
|
|
41
|
-
settings: {
|
|
42
|
-
react: {
|
|
43
|
-
version: 'detect'
|
|
44
|
-
}
|
|
45
|
-
},
|
|
46
|
-
rules: {
|
|
47
|
-
'plugin-react/function-component-definition': [
|
|
48
|
-
'error',
|
|
49
|
-
{
|
|
50
|
-
namedComponents: ['arrow-function'],
|
|
51
|
-
unnamedComponents: 'arrow-function'
|
|
52
|
-
}
|
|
53
|
-
]
|
|
54
|
-
}
|
|
55
|
-
},
|
|
26
|
+
|
|
56
27
|
{
|
|
57
28
|
name: 'siberiacancode/imports',
|
|
58
29
|
plugins: {
|
|
@@ -79,6 +50,31 @@ export const eslint = (...args) =>
|
|
|
79
50
|
]
|
|
80
51
|
}
|
|
81
52
|
},
|
|
53
|
+
{
|
|
54
|
+
name: 'siberiacancode/formatter',
|
|
55
|
+
rules: {
|
|
56
|
+
'style/jsx-one-expression-per-line': 'off',
|
|
57
|
+
'style/member-delimiter-style': 'off',
|
|
58
|
+
'style/quote-props': 'off',
|
|
59
|
+
'style/operator-linebreak': 'off',
|
|
60
|
+
'style/brace-style': 'off',
|
|
61
|
+
|
|
62
|
+
'style/max-len': [
|
|
63
|
+
'error',
|
|
64
|
+
100,
|
|
65
|
+
2,
|
|
66
|
+
{ ignoreComments: true, ignoreStrings: true, ignoreTemplateLiterals: true }
|
|
67
|
+
],
|
|
68
|
+
'style/quotes': ['error', 'single', { allowTemplateLiterals: true }],
|
|
69
|
+
'style/jsx-quotes': ['error', 'prefer-single'],
|
|
70
|
+
'style/comma-dangle': ['error', 'never'],
|
|
71
|
+
'style/semi': ['error', 'always'],
|
|
72
|
+
'style/indent': ['error', 2, { SwitchCase: 1 }],
|
|
73
|
+
'style/no-tabs': 'error',
|
|
74
|
+
'style/linebreak-style': ['error', 'unix'],
|
|
75
|
+
'style/arrow-parens': ['error', 'always']
|
|
76
|
+
}
|
|
77
|
+
},
|
|
82
78
|
...args.reduce((acc, config) => {
|
|
83
79
|
if (config['jsx-a11y']) {
|
|
84
80
|
acc.push({
|
|
@@ -88,6 +84,29 @@ export const eslint = (...args) =>
|
|
|
88
84
|
return acc;
|
|
89
85
|
}
|
|
90
86
|
|
|
87
|
+
if (config.react) {
|
|
88
|
+
acc.push({
|
|
89
|
+
name: 'siberiacancode/react',
|
|
90
|
+
plugins: {
|
|
91
|
+
'plugin-react': pluginReact
|
|
92
|
+
},
|
|
93
|
+
settings: {
|
|
94
|
+
react: {
|
|
95
|
+
version: 'detect'
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
rules: {
|
|
99
|
+
'plugin-react/function-component-definition': [
|
|
100
|
+
'error',
|
|
101
|
+
{
|
|
102
|
+
namedComponents: ['arrow-function'],
|
|
103
|
+
unnamedComponents: 'arrow-function'
|
|
104
|
+
}
|
|
105
|
+
]
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
|
|
91
110
|
acc.push({
|
|
92
111
|
...config,
|
|
93
112
|
name: `siberiacancode/${config.name}`
|
package/package.json
CHANGED
|
@@ -1,40 +1,39 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@siberiacancode/eslint",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "2.0.2",
|
|
3
5
|
"description": "eslint configs",
|
|
4
|
-
"license": "MIT",
|
|
5
|
-
"version": "2.0.0",
|
|
6
|
-
"keywords": [
|
|
7
|
-
"eslint",
|
|
8
|
-
"react",
|
|
9
|
-
"node"
|
|
10
|
-
],
|
|
11
6
|
"author": {
|
|
12
7
|
"name": "SIBERIA CAN CODE 🧊",
|
|
13
8
|
"url": "https://github.com/siberiacancode"
|
|
14
9
|
},
|
|
15
|
-
"
|
|
16
|
-
"url": "https://github.com/siberiacancode/core/issues"
|
|
17
|
-
},
|
|
10
|
+
"license": "MIT",
|
|
18
11
|
"homepage": "https://github.com/siberiacancode/core",
|
|
19
12
|
"repository": {
|
|
20
13
|
"url": "https://github.com/siberiacancode/core"
|
|
21
14
|
},
|
|
15
|
+
"bugs": {
|
|
16
|
+
"url": "https://github.com/siberiacancode/core/issues"
|
|
17
|
+
},
|
|
18
|
+
"keywords": [
|
|
19
|
+
"eslint",
|
|
20
|
+
"react",
|
|
21
|
+
"node"
|
|
22
|
+
],
|
|
22
23
|
"publishConfig": {
|
|
23
24
|
"access": "public"
|
|
24
25
|
},
|
|
25
|
-
"files": [
|
|
26
|
-
"index.js",
|
|
27
|
-
"index.d.ts"
|
|
28
|
-
],
|
|
29
26
|
"main": "index.js",
|
|
30
27
|
"types": "index.d.ts",
|
|
28
|
+
"files": [
|
|
29
|
+
"index.d.ts",
|
|
30
|
+
"index.js"
|
|
31
|
+
],
|
|
31
32
|
"scripts": {
|
|
32
33
|
"format": "prettier --write \"*.js\"",
|
|
34
|
+
"lint": "eslint . --fix",
|
|
33
35
|
"lint-inspector": "npx @eslint/config-inspector"
|
|
34
36
|
},
|
|
35
|
-
"lint-staged": {
|
|
36
|
-
"*.js": "prettier --write"
|
|
37
|
-
},
|
|
38
37
|
"peerDependencies": {
|
|
39
38
|
"eslint": "^9.9.0"
|
|
40
39
|
},
|
|
@@ -50,5 +49,15 @@
|
|
|
50
49
|
},
|
|
51
50
|
"devDependencies": {
|
|
52
51
|
"@siberiacancode/prettier": "*"
|
|
52
|
+
},
|
|
53
|
+
"lint-staged": {
|
|
54
|
+
"*.js": [
|
|
55
|
+
"prettier --write",
|
|
56
|
+
"eslint --fix"
|
|
57
|
+
],
|
|
58
|
+
"*.ts": [
|
|
59
|
+
"prettier --write",
|
|
60
|
+
"eslint --fix"
|
|
61
|
+
]
|
|
53
62
|
}
|
|
54
63
|
}
|