@rhyster/eslint-config 1.5.1 → 1.6.1
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/eslint.config.d.ts +12 -15
- package/dist/eslint.config.d.ts.map +1 -1
- package/dist/index.cjs +105 -114
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1656 -1544
- package/dist/index.d.mts +1656 -1544
- package/dist/index.d.ts +1656 -1544
- package/dist/index.mjs +101 -110
- package/dist/index.mjs.map +1 -1
- package/dist/src/index.d.ts +1653 -1542
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/rules/airbnb/best-practices.d.ts.map +1 -0
- package/dist/src/rules/airbnb/errors.d.ts.map +1 -0
- package/dist/src/rules/airbnb/es6.d.ts.map +1 -0
- package/dist/src/{airbnb → rules/airbnb}/imports.d.ts.map +1 -1
- package/dist/src/rules/airbnb/node.d.ts.map +1 -0
- package/dist/src/rules/airbnb/strict.d.ts.map +1 -0
- package/dist/src/{airbnb → rules/airbnb}/style.d.ts.map +1 -1
- package/dist/src/rules/airbnb/variables.d.ts.map +1 -0
- package/dist/src/rules/browser.d.ts +1137 -0
- package/dist/src/rules/browser.d.ts.map +1 -0
- package/dist/src/rules/general.d.ts +35 -0
- package/dist/src/rules/general.d.ts.map +1 -0
- package/dist/src/rules/typescript.d.ts.map +1 -0
- package/dist/src/rules/vue.d.ts +36 -0
- package/dist/src/rules/vue.d.ts.map +1 -0
- package/package.json +3 -3
- package/src/index.ts +35 -164
- package/src/rules/browser.ts +10 -0
- package/src/rules/general.ts +61 -0
- package/src/rules/vue.ts +67 -0
- package/dist/src/airbnb/best-practices.d.ts.map +0 -1
- package/dist/src/airbnb/errors.d.ts.map +0 -1
- package/dist/src/airbnb/es6.d.ts.map +0 -1
- package/dist/src/airbnb/node.d.ts.map +0 -1
- package/dist/src/airbnb/strict.d.ts.map +0 -1
- package/dist/src/airbnb/variables.d.ts.map +0 -1
- package/dist/src/typescript.d.ts.map +0 -1
- /package/dist/src/{airbnb → rules/airbnb}/best-practices.d.ts +0 -0
- /package/dist/src/{airbnb → rules/airbnb}/errors.d.ts +0 -0
- /package/dist/src/{airbnb → rules/airbnb}/es6.d.ts +0 -0
- /package/dist/src/{airbnb → rules/airbnb}/imports.d.ts +0 -0
- /package/dist/src/{airbnb → rules/airbnb}/node.d.ts +0 -0
- /package/dist/src/{airbnb → rules/airbnb}/strict.d.ts +0 -0
- /package/dist/src/{airbnb → rules/airbnb}/style.d.ts +0 -0
- /package/dist/src/{airbnb → rules/airbnb}/variables.d.ts +0 -0
- /package/dist/src/{typescript.d.ts → rules/typescript.d.ts} +0 -0
- /package/src/{airbnb → rules/airbnb}/best-practices.ts +0 -0
- /package/src/{airbnb → rules/airbnb}/errors.ts +0 -0
- /package/src/{airbnb → rules/airbnb}/es6.ts +0 -0
- /package/src/{airbnb → rules/airbnb}/imports.ts +0 -0
- /package/src/{airbnb → rules/airbnb}/node.ts +0 -0
- /package/src/{airbnb → rules/airbnb}/strict.ts +0 -0
- /package/src/{airbnb → rules/airbnb}/style.ts +0 -0
- /package/src/{airbnb → rules/airbnb}/variables.ts +0 -0
- /package/src/{typescript.ts → rules/typescript.ts} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../../src/rules/browser.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,wBAKmC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { Linter } from 'eslint';
|
|
2
|
+
type Config = Linter.Config;
|
|
3
|
+
type Plugin = NonNullable<Config['plugins']>[string];
|
|
4
|
+
type Parser = NonNullable<Config['languageOptions']>['parser'];
|
|
5
|
+
declare const _default: {
|
|
6
|
+
readonly name: "@rhyster/eslint-config/general";
|
|
7
|
+
readonly plugins: {
|
|
8
|
+
readonly '@typescript-eslint': Plugin;
|
|
9
|
+
readonly '@stylistic': Plugin;
|
|
10
|
+
readonly 'import-x': Plugin;
|
|
11
|
+
};
|
|
12
|
+
readonly languageOptions: {
|
|
13
|
+
readonly parser: Parser;
|
|
14
|
+
readonly parserOptions: {
|
|
15
|
+
readonly projectService: true;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
readonly settings: {
|
|
19
|
+
readonly 'import-x/parsers': {
|
|
20
|
+
readonly espree: readonly [".js", ".mjs"];
|
|
21
|
+
readonly '@typescript-eslint/parser': readonly [".ts", ".d.ts"];
|
|
22
|
+
};
|
|
23
|
+
readonly 'import-x/resolver': {
|
|
24
|
+
readonly node: {
|
|
25
|
+
readonly extensions: readonly [".mjs", ".js", ".json", ".ts", ".d.ts"];
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
readonly 'import-x/extensions': readonly [".js", ".mjs", ".ts", ".d.ts"];
|
|
29
|
+
readonly 'import-x/core-modules': readonly [];
|
|
30
|
+
readonly 'import-x/ignore': readonly ["node_modules", "\\.(coffee|scss|css|less|hbs|svg|json)$"];
|
|
31
|
+
readonly 'import-x/external-module-folders': readonly ["node_modules", "node_modules/@types"];
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
export default _default;
|
|
35
|
+
//# sourceMappingURL=general.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"general.d.ts","sourceRoot":"","sources":["../../../src/rules/general.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAErC,KAAK,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;AAC5B,KAAK,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;AACrD,KAAK,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;;;;uCAKpB,MAAM;+BACd,MAAM;6BACC,MAAM;;;yBAGnB,MAAM;;;;;;;;;;;;;;;;;;;;;AARnC,wBAkD4B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typescript.d.ts","sourceRoot":"","sources":["../../../src/rules/typescript.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,wBA0F0B"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { Linter } from 'eslint';
|
|
2
|
+
type Config = Linter.Config;
|
|
3
|
+
type Plugin = NonNullable<Config['plugins']>[string];
|
|
4
|
+
declare const _default: (Config | {
|
|
5
|
+
readonly name: "@rhyster/eslint-config/airbnb/general-vue";
|
|
6
|
+
readonly plugins: {
|
|
7
|
+
readonly vue: Plugin;
|
|
8
|
+
readonly '@typescript-eslint': import("eslint").ESLint.Plugin;
|
|
9
|
+
readonly '@stylistic': import("eslint").ESLint.Plugin;
|
|
10
|
+
readonly 'import-x': import("eslint").ESLint.Plugin;
|
|
11
|
+
};
|
|
12
|
+
readonly settings: {
|
|
13
|
+
readonly 'import-x/parsers': {
|
|
14
|
+
readonly 'vue-eslint-parser': readonly [".vue"];
|
|
15
|
+
readonly espree: readonly [".js", ".mjs"];
|
|
16
|
+
readonly '@typescript-eslint/parser': readonly [".ts", ".d.ts"];
|
|
17
|
+
};
|
|
18
|
+
readonly 'import-x/resolver': {
|
|
19
|
+
readonly node: {
|
|
20
|
+
readonly extensions: readonly [".mjs", ".js", ".json", ".ts", ".d.ts", ".vue"];
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
readonly 'import-x/extensions': readonly [".js", ".mjs", ".ts", ".d.ts", ".vue"];
|
|
24
|
+
readonly 'import-x/core-modules': readonly [];
|
|
25
|
+
readonly 'import-x/ignore': readonly ["node_modules", "\\.(coffee|scss|css|less|hbs|svg|json)$"];
|
|
26
|
+
readonly 'import-x/external-module-folders': readonly ["node_modules", "node_modules/@types"];
|
|
27
|
+
};
|
|
28
|
+
readonly languageOptions: {
|
|
29
|
+
readonly parser: Linter.Parser | undefined;
|
|
30
|
+
readonly parserOptions: {
|
|
31
|
+
readonly projectService: true;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
})[];
|
|
35
|
+
export default _default;
|
|
36
|
+
//# sourceMappingURL=vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vue.d.ts","sourceRoot":"","sources":["../../../src/rules/vue.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAErC,KAAK,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;AAC5B,KAAK,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;;;;sBAQ3B,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4ChC,wBAKqB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rhyster/eslint-config",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.1",
|
|
4
4
|
"description": "ESLint config",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -46,14 +46,14 @@
|
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"@eslint/js": "^9.16.0",
|
|
49
|
-
"@stylistic/eslint-plugin": "^2.
|
|
49
|
+
"@stylistic/eslint-plugin": "^2.12.0",
|
|
50
50
|
"confusing-browser-globals": "^1.0.11",
|
|
51
51
|
"eslint-import-resolver-typescript": "^3.7.0",
|
|
52
52
|
"eslint-plugin-import-x": "^4.5.0",
|
|
53
53
|
"eslint-plugin-n": "^17.14.0",
|
|
54
54
|
"eslint-plugin-vue": "^9.32.0",
|
|
55
55
|
"globals": "^15.13.0",
|
|
56
|
-
"typescript-eslint": "^8.
|
|
56
|
+
"typescript-eslint": "^8.18.0",
|
|
57
57
|
"vue-eslint-parser": "^9.4.3"
|
|
58
58
|
},
|
|
59
59
|
"packageManager": "pnpm@9.15.0"
|
package/src/index.ts
CHANGED
|
@@ -1,136 +1,27 @@
|
|
|
1
1
|
import js from '@eslint/js';
|
|
2
|
-
import stylistic from '@stylistic/eslint-plugin';
|
|
3
|
-
import importx from 'eslint-plugin-import-x';
|
|
4
2
|
import nodePlugin from 'eslint-plugin-n';
|
|
5
|
-
import vuePlugin from 'eslint-plugin-vue';
|
|
6
3
|
import globals from 'globals';
|
|
7
4
|
import ts from 'typescript-eslint';
|
|
8
|
-
import vueParser from 'vue-eslint-parser';
|
|
9
5
|
|
|
10
|
-
import bestPractices from './airbnb/best-practices.ts';
|
|
11
|
-
import errors from './airbnb/errors.ts';
|
|
12
|
-
import es6 from './airbnb/es6.ts';
|
|
13
|
-
import imports from './airbnb/imports.ts';
|
|
14
|
-
import nodeRules from './airbnb/node.ts';
|
|
15
|
-
import strict from './airbnb/strict.ts';
|
|
16
|
-
import style from './airbnb/style.ts';
|
|
17
|
-
import variables from './airbnb/variables.ts';
|
|
18
|
-
import
|
|
6
|
+
import bestPractices from './rules/airbnb/best-practices.ts';
|
|
7
|
+
import errors from './rules/airbnb/errors.ts';
|
|
8
|
+
import es6 from './rules/airbnb/es6.ts';
|
|
9
|
+
import imports from './rules/airbnb/imports.ts';
|
|
10
|
+
import nodeRules from './rules/airbnb/node.ts';
|
|
11
|
+
import strict from './rules/airbnb/strict.ts';
|
|
12
|
+
import style from './rules/airbnb/style.ts';
|
|
13
|
+
import variables from './rules/airbnb/variables.ts';
|
|
14
|
+
import browserRules from './rules/browser.ts';
|
|
15
|
+
import general from './rules/general.ts';
|
|
16
|
+
import typescript from './rules/typescript.ts';
|
|
17
|
+
import vueRules from './rules/vue.ts';
|
|
19
18
|
|
|
20
19
|
import type { Linter } from 'eslint';
|
|
21
20
|
|
|
22
21
|
type Config = Linter.Config;
|
|
23
|
-
type Plugin = NonNullable<Config['plugins']>[string];
|
|
24
|
-
type Parser = NonNullable<Config['languageOptions']>['parser'];
|
|
25
22
|
|
|
26
|
-
const
|
|
27
|
-
name: '@rhyster/eslint-config/airbnb/general',
|
|
28
|
-
plugins: {
|
|
29
|
-
'@typescript-eslint': ts.plugin as Plugin,
|
|
30
|
-
'@stylistic': stylistic as Plugin,
|
|
31
|
-
'import-x': importx as unknown as Plugin,
|
|
32
|
-
},
|
|
33
|
-
languageOptions: {
|
|
34
|
-
parser: ts.parser as Parser,
|
|
35
|
-
parserOptions: {
|
|
36
|
-
projectService: true,
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
settings: {
|
|
40
|
-
'import-x/parsers': {
|
|
41
|
-
espree: [
|
|
42
|
-
'.js',
|
|
43
|
-
'.mjs',
|
|
44
|
-
],
|
|
45
|
-
'@typescript-eslint/parser': [
|
|
46
|
-
'.ts',
|
|
47
|
-
'.d.ts',
|
|
48
|
-
],
|
|
49
|
-
},
|
|
50
|
-
'import-x/resolver': {
|
|
51
|
-
node: {
|
|
52
|
-
extensions: [
|
|
53
|
-
'.mjs',
|
|
54
|
-
'.js',
|
|
55
|
-
'.json',
|
|
56
|
-
'.ts',
|
|
57
|
-
'.d.ts',
|
|
58
|
-
],
|
|
59
|
-
},
|
|
60
|
-
},
|
|
61
|
-
'import-x/extensions': [
|
|
62
|
-
'.js',
|
|
63
|
-
'.mjs',
|
|
64
|
-
'.ts',
|
|
65
|
-
'.d.ts',
|
|
66
|
-
],
|
|
67
|
-
'import-x/core-modules': [],
|
|
68
|
-
'import-x/ignore': [
|
|
69
|
-
'node_modules', '\\.(coffee|scss|css|less|hbs|svg|json)$',
|
|
70
|
-
],
|
|
71
|
-
'import-x/external-module-folders': [
|
|
72
|
-
'node_modules',
|
|
73
|
-
'node_modules/@types',
|
|
74
|
-
],
|
|
75
|
-
},
|
|
76
|
-
} as const satisfies Config;
|
|
77
|
-
|
|
78
|
-
const browserRules = {
|
|
79
|
-
name: '@rhyster/eslint-config/airbnb/browser',
|
|
80
|
-
languageOptions: {
|
|
81
|
-
globals: globals.browser,
|
|
82
|
-
},
|
|
83
|
-
} as const satisfies Config;
|
|
84
|
-
|
|
85
|
-
const generalVue = {
|
|
86
|
-
...general,
|
|
87
|
-
name: '@rhyster/eslint-config/airbnb/general-vue',
|
|
88
|
-
plugins: {
|
|
89
|
-
...general.plugins,
|
|
90
|
-
vue: vuePlugin as Plugin,
|
|
91
|
-
},
|
|
92
|
-
settings: {
|
|
93
|
-
...general.settings,
|
|
94
|
-
'import-x/parsers': {
|
|
95
|
-
...general.settings['import-x/parsers'],
|
|
96
|
-
'vue-eslint-parser': [
|
|
97
|
-
'.vue',
|
|
98
|
-
],
|
|
99
|
-
},
|
|
100
|
-
'import-x/resolver': {
|
|
101
|
-
node: {
|
|
102
|
-
extensions: [
|
|
103
|
-
...general.settings['import-x/resolver'].node.extensions,
|
|
104
|
-
'.vue',
|
|
105
|
-
],
|
|
106
|
-
},
|
|
107
|
-
},
|
|
108
|
-
'import-x/extensions': [
|
|
109
|
-
...general.settings['import-x/extensions'],
|
|
110
|
-
'.vue',
|
|
111
|
-
],
|
|
112
|
-
},
|
|
113
|
-
} as const satisfies Config;
|
|
114
|
-
|
|
115
|
-
const setupVue: Config = {
|
|
116
|
-
name: '@rhyster/eslint-config/setup-vue',
|
|
117
|
-
files: ['**/*.vue'],
|
|
118
|
-
languageOptions: {
|
|
119
|
-
parser: vueParser,
|
|
120
|
-
parserOptions: {
|
|
121
|
-
projectService: true,
|
|
122
|
-
parser: ts.parser,
|
|
123
|
-
extraFileExtensions: ['.vue'],
|
|
124
|
-
},
|
|
125
|
-
},
|
|
126
|
-
} as const satisfies Config;
|
|
127
|
-
|
|
128
|
-
export const core = [
|
|
23
|
+
const coreConfigs = [
|
|
129
24
|
js.configs.recommended,
|
|
130
|
-
{
|
|
131
|
-
name: '@rhyster/eslint-config/files-ts',
|
|
132
|
-
files: ['**/*.ts'],
|
|
133
|
-
},
|
|
134
25
|
general,
|
|
135
26
|
...ts.configs.strictTypeChecked as unknown as Config[],
|
|
136
27
|
...ts.configs.stylisticTypeChecked as unknown as Config[],
|
|
@@ -144,64 +35,44 @@ export const core = [
|
|
|
144
35
|
typescript,
|
|
145
36
|
] as const satisfies Config[];
|
|
146
37
|
|
|
38
|
+
export const core = coreConfigs.map((config) => ({
|
|
39
|
+
...config,
|
|
40
|
+
files: ['src/**/*.ts'],
|
|
41
|
+
})) satisfies Config[];
|
|
42
|
+
|
|
147
43
|
export const node = [
|
|
148
44
|
...core,
|
|
149
45
|
{
|
|
46
|
+
name: '@rhyster/eslint-config/setup-node',
|
|
47
|
+
files: ['src/**/*.ts'],
|
|
150
48
|
languageOptions: {
|
|
151
49
|
globals: globals.node,
|
|
152
50
|
},
|
|
153
51
|
plugins: {
|
|
154
52
|
n: nodePlugin,
|
|
155
53
|
},
|
|
54
|
+
},
|
|
55
|
+
{
|
|
156
56
|
...nodeRules,
|
|
57
|
+
files: ['src/**/*.ts'],
|
|
157
58
|
},
|
|
158
59
|
] as const satisfies Config[];
|
|
159
60
|
|
|
160
61
|
export const browser = [
|
|
161
62
|
...core,
|
|
162
|
-
browserRules,
|
|
163
|
-
] as const satisfies Config[];
|
|
164
|
-
|
|
165
|
-
export const vue = [
|
|
166
|
-
js.configs.recommended,
|
|
167
|
-
{
|
|
168
|
-
name: '@rhyster/eslint-config/files-ts',
|
|
169
|
-
files: ['**/*.ts'],
|
|
170
|
-
},
|
|
171
63
|
{
|
|
172
|
-
|
|
173
|
-
files: ['
|
|
64
|
+
...browserRules,
|
|
65
|
+
files: ['src/**/*.ts'],
|
|
174
66
|
},
|
|
175
|
-
|
|
176
|
-
...ts.configs.strictTypeChecked.map((config) => {
|
|
177
|
-
if (config.files?.includes('**/*.ts') === true) {
|
|
178
|
-
return {
|
|
179
|
-
...config,
|
|
180
|
-
files: [...config.files, '**/*.vue'],
|
|
181
|
-
};
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
return config;
|
|
185
|
-
}) as unknown as Config[],
|
|
186
|
-
...ts.configs.stylisticTypeChecked.map((config) => {
|
|
187
|
-
if (config.files?.includes('**/*.ts') === true) {
|
|
188
|
-
return {
|
|
189
|
-
...config,
|
|
190
|
-
files: [...config.files, '**/*.vue'],
|
|
191
|
-
};
|
|
192
|
-
}
|
|
67
|
+
] as const satisfies Config[];
|
|
193
68
|
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
typescript,
|
|
204
|
-
browserRules,
|
|
205
|
-
...vuePlugin.configs['flat/recommended'] as unknown as Config[],
|
|
206
|
-
setupVue,
|
|
69
|
+
export const vue = [
|
|
70
|
+
...browser.map((config) => ({
|
|
71
|
+
...config,
|
|
72
|
+
files: ['src/**/*.ts', 'src/**/*.vue'],
|
|
73
|
+
})),
|
|
74
|
+
...vueRules.map((config) => ({
|
|
75
|
+
...config,
|
|
76
|
+
files: ['src/**/*.vue'],
|
|
77
|
+
})),
|
|
207
78
|
] as const satisfies Config[];
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import stylistic from '@stylistic/eslint-plugin';
|
|
2
|
+
import importx from 'eslint-plugin-import-x';
|
|
3
|
+
import ts from 'typescript-eslint';
|
|
4
|
+
|
|
5
|
+
import type { Linter } from 'eslint';
|
|
6
|
+
|
|
7
|
+
type Config = Linter.Config;
|
|
8
|
+
type Plugin = NonNullable<Config['plugins']>[string];
|
|
9
|
+
type Parser = NonNullable<Config['languageOptions']>['parser'];
|
|
10
|
+
|
|
11
|
+
export default {
|
|
12
|
+
name: '@rhyster/eslint-config/general',
|
|
13
|
+
plugins: {
|
|
14
|
+
'@typescript-eslint': ts.plugin as Plugin,
|
|
15
|
+
'@stylistic': stylistic as Plugin,
|
|
16
|
+
'import-x': importx as unknown as Plugin,
|
|
17
|
+
},
|
|
18
|
+
languageOptions: {
|
|
19
|
+
parser: ts.parser as Parser,
|
|
20
|
+
parserOptions: {
|
|
21
|
+
projectService: true,
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
settings: {
|
|
25
|
+
'import-x/parsers': {
|
|
26
|
+
espree: [
|
|
27
|
+
'.js',
|
|
28
|
+
'.mjs',
|
|
29
|
+
],
|
|
30
|
+
'@typescript-eslint/parser': [
|
|
31
|
+
'.ts',
|
|
32
|
+
'.d.ts',
|
|
33
|
+
],
|
|
34
|
+
},
|
|
35
|
+
'import-x/resolver': {
|
|
36
|
+
node: {
|
|
37
|
+
extensions: [
|
|
38
|
+
'.mjs',
|
|
39
|
+
'.js',
|
|
40
|
+
'.json',
|
|
41
|
+
'.ts',
|
|
42
|
+
'.d.ts',
|
|
43
|
+
],
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
'import-x/extensions': [
|
|
47
|
+
'.js',
|
|
48
|
+
'.mjs',
|
|
49
|
+
'.ts',
|
|
50
|
+
'.d.ts',
|
|
51
|
+
],
|
|
52
|
+
'import-x/core-modules': [],
|
|
53
|
+
'import-x/ignore': [
|
|
54
|
+
'node_modules', '\\.(coffee|scss|css|less|hbs|svg|json)$',
|
|
55
|
+
],
|
|
56
|
+
'import-x/external-module-folders': [
|
|
57
|
+
'node_modules',
|
|
58
|
+
'node_modules/@types',
|
|
59
|
+
],
|
|
60
|
+
},
|
|
61
|
+
} as const satisfies Config;
|
package/src/rules/vue.ts
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import vuePlugin from 'eslint-plugin-vue';
|
|
2
|
+
import ts from 'typescript-eslint';
|
|
3
|
+
import vueParser from 'vue-eslint-parser';
|
|
4
|
+
|
|
5
|
+
import general from './general.ts';
|
|
6
|
+
|
|
7
|
+
import type { Linter } from 'eslint';
|
|
8
|
+
|
|
9
|
+
type Config = Linter.Config;
|
|
10
|
+
type Plugin = NonNullable<Config['plugins']>[string];
|
|
11
|
+
type Parser = NonNullable<Config['languageOptions']>['parser'];
|
|
12
|
+
|
|
13
|
+
const generalVue = {
|
|
14
|
+
...general,
|
|
15
|
+
name: '@rhyster/eslint-config/airbnb/general-vue',
|
|
16
|
+
plugins: {
|
|
17
|
+
...general.plugins,
|
|
18
|
+
vue: vuePlugin as Plugin,
|
|
19
|
+
},
|
|
20
|
+
settings: {
|
|
21
|
+
...general.settings,
|
|
22
|
+
'import-x/parsers': {
|
|
23
|
+
...general.settings['import-x/parsers'],
|
|
24
|
+
'vue-eslint-parser': [
|
|
25
|
+
'.vue',
|
|
26
|
+
],
|
|
27
|
+
},
|
|
28
|
+
'import-x/resolver': {
|
|
29
|
+
node: {
|
|
30
|
+
extensions: [
|
|
31
|
+
...general.settings['import-x/resolver'].node.extensions,
|
|
32
|
+
'.vue',
|
|
33
|
+
],
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
'import-x/extensions': [
|
|
37
|
+
...general.settings['import-x/extensions'],
|
|
38
|
+
'.vue',
|
|
39
|
+
],
|
|
40
|
+
},
|
|
41
|
+
} as const satisfies Config;
|
|
42
|
+
|
|
43
|
+
const setupVue: Config = {
|
|
44
|
+
name: '@rhyster/eslint-config/setup-vue',
|
|
45
|
+
languageOptions: {
|
|
46
|
+
parser: vueParser,
|
|
47
|
+
parserOptions: {
|
|
48
|
+
projectService: true,
|
|
49
|
+
parser: ts.parser as Parser,
|
|
50
|
+
extraFileExtensions: ['.vue'],
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
} as const satisfies Config;
|
|
54
|
+
|
|
55
|
+
const vueConfigs: Config = {
|
|
56
|
+
name: '@rhyster/eslint-config/vue-configs',
|
|
57
|
+
rules: {
|
|
58
|
+
'import-x/no-unused-modules': 'off',
|
|
59
|
+
},
|
|
60
|
+
} as const satisfies Config;
|
|
61
|
+
|
|
62
|
+
export default [
|
|
63
|
+
generalVue,
|
|
64
|
+
...vuePlugin.configs['flat/recommended'] as unknown as Config[],
|
|
65
|
+
setupVue,
|
|
66
|
+
vueConfigs,
|
|
67
|
+
] satisfies Config[];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"best-practices.d.ts","sourceRoot":"","sources":["../../../src/airbnb/best-practices.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,wBA0d0B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/airbnb/errors.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,wBAwN0B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"es6.d.ts","sourceRoot":"","sources":["../../../src/airbnb/es6.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,wBA+M0B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../../src/airbnb/node.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAEA,wBAmD0B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"strict.d.ts","sourceRoot":"","sources":["../../../src/airbnb/strict.ts"],"names":[],"mappings":";;;;;;AAEA,wBAM0B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"variables.d.ts","sourceRoot":"","sources":["../../../src/airbnb/variables.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,wBAqE0B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"typescript.d.ts","sourceRoot":"","sources":["../../src/typescript.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,wBA0F0B"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|