@vinicunca/eslint-config 2.0.0-beta.0 → 2.0.0-beta.5

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.
@@ -0,0 +1,226 @@
1
+ import * as eslint_define_config from 'eslint-define-config';
2
+ import { FlatESLintConfigItem as FlatESLintConfigItem$1 } from 'eslint-define-config';
3
+ import { ParserOptions } from '@typescript-eslint/parser';
4
+ import * as parser from '@typescript-eslint/parser';
5
+ export { parser as parserTs };
6
+ export { default as pluginStylistic } from '@stylistic/eslint-plugin';
7
+ export { default as pluginVinicunca } from '@vinicunca/eslint-plugin-vinicunca';
8
+ export { default as pluginTs } from '@typescript-eslint/eslint-plugin';
9
+ export { default as pluginComments } from 'eslint-plugin-eslint-comments';
10
+ import * as eslintPluginI from 'eslint-plugin-i';
11
+ export { eslintPluginI as pluginImport };
12
+ export { default as pluginJsdoc } from 'eslint-plugin-jsdoc';
13
+ import * as eslintPluginJsonc from 'eslint-plugin-jsonc';
14
+ export { eslintPluginJsonc as pluginJsonc };
15
+ export { default as pluginMarkdown } from 'eslint-plugin-markdown';
16
+ export { default as pluginNode } from 'eslint-plugin-n';
17
+ export { default as pluginNoOnlyTests } from 'eslint-plugin-no-only-tests';
18
+ export { default as pluginUnicorn } from 'eslint-plugin-unicorn';
19
+ export { default as pluginUnusedImports } from 'eslint-plugin-unused-imports';
20
+ export { default as pluginReact } from 'eslint-plugin-react';
21
+ export { default as pluginReactHooks } from 'eslint-plugin-react-hooks';
22
+ export { default as pluginVue } from 'eslint-plugin-vue';
23
+ import * as eslintPluginYml from 'eslint-plugin-yml';
24
+ export { eslintPluginYml as pluginYaml };
25
+ export { default as pluginVitest } from 'eslint-plugin-vitest';
26
+ export { default as parserJsonc } from 'jsonc-eslint-parser';
27
+ export { default as parserVue } from 'vue-eslint-parser';
28
+ export { default as parserYaml } from 'yaml-eslint-parser';
29
+
30
+ interface FlatESLintConfigItem extends FlatESLintConfigItem$1 {
31
+ /**
32
+ * The name of the configuration object.
33
+ */
34
+ name?: string;
35
+ }
36
+ interface OptionsConfig extends OptionsComponentExts {
37
+ /**
38
+ * Additional options for the ignore rules.
39
+ */
40
+ ignores?: OptionsIgnores;
41
+ /**
42
+ * Enable TypeScript support.
43
+ *
44
+ * Passing an object to enable TypeScript Language Server support.
45
+ *
46
+ * @default auto-detect based on the dependencies
47
+ */
48
+ typescript?: boolean | OptionsTypeScriptWithTypes;
49
+ /**
50
+ * Enable test support.
51
+ *
52
+ * @default true
53
+ */
54
+ test?: boolean;
55
+ /**
56
+ * Enable Vue support.
57
+ *
58
+ * @default auto-detect based on the dependencies
59
+ */
60
+ vue?: boolean;
61
+ /**
62
+ * Enable JSONC support.
63
+ *
64
+ * @default true
65
+ */
66
+ jsonc?: boolean;
67
+ /**
68
+ * Enable YAML support.
69
+ *
70
+ * @default true
71
+ */
72
+ yaml?: boolean;
73
+ /**
74
+ * Enable Markdown support.
75
+ *
76
+ * @default true
77
+ */
78
+ markdown?: boolean;
79
+ /**
80
+ * Enable stylistic rules.
81
+ *
82
+ * @default true
83
+ */
84
+ stylistic?: boolean;
85
+ /**
86
+ * Enable sonarjs rules.
87
+ *
88
+ * @default true
89
+ */
90
+ sonar?: boolean;
91
+ /**
92
+ * Enable react support.
93
+ * In This plugin, react is not supported as a first class citizen. 😎
94
+ *
95
+ * @default false
96
+ */
97
+ react?: boolean;
98
+ /**
99
+ * Control to disable some rules in editors.
100
+ * @default auto-detect based on the process.env
101
+ */
102
+ isInEditor?: boolean;
103
+ /**
104
+ * Provide overrides for rules for each integration.
105
+ */
106
+ overrides?: {
107
+ javascript?: FlatESLintConfigItem['rules'];
108
+ typescript?: FlatESLintConfigItem['rules'];
109
+ test?: FlatESLintConfigItem['rules'];
110
+ vue?: FlatESLintConfigItem['rules'];
111
+ jsonc?: FlatESLintConfigItem['rules'];
112
+ markdown?: FlatESLintConfigItem['rules'];
113
+ yaml?: FlatESLintConfigItem['rules'];
114
+ react?: FlatESLintConfigItem['rules'];
115
+ };
116
+ }
117
+ interface OptionsOverrides {
118
+ overrides?: FlatESLintConfigItem['rules'];
119
+ }
120
+ interface OptionsIsInEditor {
121
+ isInEditor?: boolean;
122
+ }
123
+ interface OptionsIgnores {
124
+ enableGitignore?: boolean;
125
+ items?: string[];
126
+ replace?: boolean;
127
+ }
128
+ interface OptionsComponentExts {
129
+ /**
130
+ * Additional extensions for components.
131
+ *
132
+ * @example ['vue']
133
+ * @default []
134
+ */
135
+ componentExts?: string[];
136
+ }
137
+ interface OptionsTypeScriptParserOptions {
138
+ /**
139
+ * Additional parser options for TypeScript.
140
+ */
141
+ parserOptions?: Partial<ParserOptions>;
142
+ }
143
+ interface OptionsTypeScriptWithTypes {
144
+ /**
145
+ * When this options is provided, type aware rules will be enabled.
146
+ * @see https://typescript-eslint.io/linting/typed-linting/
147
+ */
148
+ tsconfigPath?: string;
149
+ }
150
+ interface OptionsHasTypeScript {
151
+ typescript?: boolean;
152
+ }
153
+
154
+ declare function vinicuncaESLint({ options, userConfigs }: {
155
+ options?: OptionsConfig;
156
+ userConfigs: (FlatESLintConfigItem | FlatESLintConfigItem[])[];
157
+ }): eslint_define_config.FlatESLintConfigItem[];
158
+
159
+ declare function comments(): FlatESLintConfigItem[];
160
+
161
+ declare function ignores({ enableGitignore, items, replace, }?: OptionsIgnores): FlatESLintConfigItem[];
162
+
163
+ declare function imports(): FlatESLintConfigItem[];
164
+
165
+ declare function javascript(options?: OptionsIsInEditor & OptionsOverrides): FlatESLintConfigItem[];
166
+
167
+ declare function jsdoc(): FlatESLintConfigItem[];
168
+
169
+ declare function jsonc(options?: OptionsOverrides): FlatESLintConfigItem[];
170
+
171
+ declare function markdown(options?: OptionsComponentExts & OptionsOverrides): FlatESLintConfigItem[];
172
+
173
+ declare function node(): FlatESLintConfigItem[];
174
+
175
+ declare function react(options?: OptionsOverrides): FlatESLintConfigItem[];
176
+
177
+ /**
178
+ * Sort package.json
179
+ *
180
+ * Requires `jsonc` config
181
+ */
182
+ declare function sortPackageJson(): FlatESLintConfigItem[];
183
+ /**
184
+ * Sort tsconfig.json
185
+ *
186
+ * Requires `jsonc` config
187
+ */
188
+ declare function sortTsconfig(): FlatESLintConfigItem[];
189
+
190
+ declare function stylistic(): FlatESLintConfigItem[];
191
+
192
+ declare function test(options?: OptionsIsInEditor & OptionsOverrides): FlatESLintConfigItem[];
193
+
194
+ declare function typescript(options?: OptionsComponentExts & OptionsOverrides & OptionsTypeScriptWithTypes & OptionsTypeScriptParserOptions): FlatESLintConfigItem[];
195
+
196
+ declare function unicorn(options?: OptionsOverrides): FlatESLintConfigItem[];
197
+
198
+ declare function vue(options?: OptionsHasTypeScript & OptionsOverrides): FlatESLintConfigItem[];
199
+
200
+ declare function yaml(options?: OptionsOverrides): FlatESLintConfigItem[];
201
+
202
+ /**
203
+ * Combine array and non-array configs into a single array.
204
+ */
205
+ declare function combineConfigs(...configs: (FlatESLintConfigItem$1 | FlatESLintConfigItem$1[])[]): FlatESLintConfigItem$1[];
206
+ declare function renameRules(rules: Record<string, any>, from: string, to: string): {
207
+ [k: string]: any;
208
+ };
209
+
210
+ declare const GLOB_JS = "**/*.?([cm])js";
211
+ declare const GLOB_JSX = "**/*.?([cm])jsx";
212
+ declare const GLOB_TS = "**/*.?([cm])ts";
213
+ declare const GLOB_TSX = "**/*.?([cm])tsx";
214
+ declare const GLOB_EXCLUDE: string[];
215
+ declare const GLOB_SRC = "**/*.?([cm])[jt]s?(x)";
216
+ declare const GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
217
+ declare const GLOB_TESTS: string[];
218
+ declare const GLOB_VUE = "**/*.vue";
219
+ declare const GLOB_JSON = "**/*.json";
220
+ declare const GLOB_JSON5 = "**/*.json5";
221
+ declare const GLOB_JSONC = "**/*.jsonc";
222
+ declare const GLOB_YAML = "**/*.y?(a)ml";
223
+ declare const GLOB_MARKDOWN = "**/*.md";
224
+ declare const GLOB_MARKDOWN_CODE = "**/*.md/**/*.?([cm])[jt]s?(x)";
225
+
226
+ export { FlatESLintConfigItem, GLOB_EXCLUDE, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_SRC, GLOB_SRC_EXT, GLOB_TESTS, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, OptionsComponentExts, OptionsConfig, OptionsHasTypeScript, OptionsIgnores, OptionsIsInEditor, OptionsOverrides, OptionsTypeScriptParserOptions, OptionsTypeScriptWithTypes, combineConfigs, comments, vinicuncaESLint as default, ignores, imports, javascript, jsdoc, jsonc, markdown, node, react, renameRules, sortPackageJson, sortTsconfig, stylistic, test, typescript, unicorn, vinicuncaESLint, vue, yaml };
@@ -0,0 +1,226 @@
1
+ import * as eslint_define_config from 'eslint-define-config';
2
+ import { FlatESLintConfigItem as FlatESLintConfigItem$1 } from 'eslint-define-config';
3
+ import { ParserOptions } from '@typescript-eslint/parser';
4
+ import * as parser from '@typescript-eslint/parser';
5
+ export { parser as parserTs };
6
+ export { default as pluginStylistic } from '@stylistic/eslint-plugin';
7
+ export { default as pluginVinicunca } from '@vinicunca/eslint-plugin-vinicunca';
8
+ export { default as pluginTs } from '@typescript-eslint/eslint-plugin';
9
+ export { default as pluginComments } from 'eslint-plugin-eslint-comments';
10
+ import * as eslintPluginI from 'eslint-plugin-i';
11
+ export { eslintPluginI as pluginImport };
12
+ export { default as pluginJsdoc } from 'eslint-plugin-jsdoc';
13
+ import * as eslintPluginJsonc from 'eslint-plugin-jsonc';
14
+ export { eslintPluginJsonc as pluginJsonc };
15
+ export { default as pluginMarkdown } from 'eslint-plugin-markdown';
16
+ export { default as pluginNode } from 'eslint-plugin-n';
17
+ export { default as pluginNoOnlyTests } from 'eslint-plugin-no-only-tests';
18
+ export { default as pluginUnicorn } from 'eslint-plugin-unicorn';
19
+ export { default as pluginUnusedImports } from 'eslint-plugin-unused-imports';
20
+ export { default as pluginReact } from 'eslint-plugin-react';
21
+ export { default as pluginReactHooks } from 'eslint-plugin-react-hooks';
22
+ export { default as pluginVue } from 'eslint-plugin-vue';
23
+ import * as eslintPluginYml from 'eslint-plugin-yml';
24
+ export { eslintPluginYml as pluginYaml };
25
+ export { default as pluginVitest } from 'eslint-plugin-vitest';
26
+ export { default as parserJsonc } from 'jsonc-eslint-parser';
27
+ export { default as parserVue } from 'vue-eslint-parser';
28
+ export { default as parserYaml } from 'yaml-eslint-parser';
29
+
30
+ interface FlatESLintConfigItem extends FlatESLintConfigItem$1 {
31
+ /**
32
+ * The name of the configuration object.
33
+ */
34
+ name?: string;
35
+ }
36
+ interface OptionsConfig extends OptionsComponentExts {
37
+ /**
38
+ * Additional options for the ignore rules.
39
+ */
40
+ ignores?: OptionsIgnores;
41
+ /**
42
+ * Enable TypeScript support.
43
+ *
44
+ * Passing an object to enable TypeScript Language Server support.
45
+ *
46
+ * @default auto-detect based on the dependencies
47
+ */
48
+ typescript?: boolean | OptionsTypeScriptWithTypes;
49
+ /**
50
+ * Enable test support.
51
+ *
52
+ * @default true
53
+ */
54
+ test?: boolean;
55
+ /**
56
+ * Enable Vue support.
57
+ *
58
+ * @default auto-detect based on the dependencies
59
+ */
60
+ vue?: boolean;
61
+ /**
62
+ * Enable JSONC support.
63
+ *
64
+ * @default true
65
+ */
66
+ jsonc?: boolean;
67
+ /**
68
+ * Enable YAML support.
69
+ *
70
+ * @default true
71
+ */
72
+ yaml?: boolean;
73
+ /**
74
+ * Enable Markdown support.
75
+ *
76
+ * @default true
77
+ */
78
+ markdown?: boolean;
79
+ /**
80
+ * Enable stylistic rules.
81
+ *
82
+ * @default true
83
+ */
84
+ stylistic?: boolean;
85
+ /**
86
+ * Enable sonarjs rules.
87
+ *
88
+ * @default true
89
+ */
90
+ sonar?: boolean;
91
+ /**
92
+ * Enable react support.
93
+ * In This plugin, react is not supported as a first class citizen. 😎
94
+ *
95
+ * @default false
96
+ */
97
+ react?: boolean;
98
+ /**
99
+ * Control to disable some rules in editors.
100
+ * @default auto-detect based on the process.env
101
+ */
102
+ isInEditor?: boolean;
103
+ /**
104
+ * Provide overrides for rules for each integration.
105
+ */
106
+ overrides?: {
107
+ javascript?: FlatESLintConfigItem['rules'];
108
+ typescript?: FlatESLintConfigItem['rules'];
109
+ test?: FlatESLintConfigItem['rules'];
110
+ vue?: FlatESLintConfigItem['rules'];
111
+ jsonc?: FlatESLintConfigItem['rules'];
112
+ markdown?: FlatESLintConfigItem['rules'];
113
+ yaml?: FlatESLintConfigItem['rules'];
114
+ react?: FlatESLintConfigItem['rules'];
115
+ };
116
+ }
117
+ interface OptionsOverrides {
118
+ overrides?: FlatESLintConfigItem['rules'];
119
+ }
120
+ interface OptionsIsInEditor {
121
+ isInEditor?: boolean;
122
+ }
123
+ interface OptionsIgnores {
124
+ enableGitignore?: boolean;
125
+ items?: string[];
126
+ replace?: boolean;
127
+ }
128
+ interface OptionsComponentExts {
129
+ /**
130
+ * Additional extensions for components.
131
+ *
132
+ * @example ['vue']
133
+ * @default []
134
+ */
135
+ componentExts?: string[];
136
+ }
137
+ interface OptionsTypeScriptParserOptions {
138
+ /**
139
+ * Additional parser options for TypeScript.
140
+ */
141
+ parserOptions?: Partial<ParserOptions>;
142
+ }
143
+ interface OptionsTypeScriptWithTypes {
144
+ /**
145
+ * When this options is provided, type aware rules will be enabled.
146
+ * @see https://typescript-eslint.io/linting/typed-linting/
147
+ */
148
+ tsconfigPath?: string;
149
+ }
150
+ interface OptionsHasTypeScript {
151
+ typescript?: boolean;
152
+ }
153
+
154
+ declare function vinicuncaESLint({ options, userConfigs }: {
155
+ options?: OptionsConfig;
156
+ userConfigs: (FlatESLintConfigItem | FlatESLintConfigItem[])[];
157
+ }): eslint_define_config.FlatESLintConfigItem[];
158
+
159
+ declare function comments(): FlatESLintConfigItem[];
160
+
161
+ declare function ignores({ enableGitignore, items, replace, }?: OptionsIgnores): FlatESLintConfigItem[];
162
+
163
+ declare function imports(): FlatESLintConfigItem[];
164
+
165
+ declare function javascript(options?: OptionsIsInEditor & OptionsOverrides): FlatESLintConfigItem[];
166
+
167
+ declare function jsdoc(): FlatESLintConfigItem[];
168
+
169
+ declare function jsonc(options?: OptionsOverrides): FlatESLintConfigItem[];
170
+
171
+ declare function markdown(options?: OptionsComponentExts & OptionsOverrides): FlatESLintConfigItem[];
172
+
173
+ declare function node(): FlatESLintConfigItem[];
174
+
175
+ declare function react(options?: OptionsOverrides): FlatESLintConfigItem[];
176
+
177
+ /**
178
+ * Sort package.json
179
+ *
180
+ * Requires `jsonc` config
181
+ */
182
+ declare function sortPackageJson(): FlatESLintConfigItem[];
183
+ /**
184
+ * Sort tsconfig.json
185
+ *
186
+ * Requires `jsonc` config
187
+ */
188
+ declare function sortTsconfig(): FlatESLintConfigItem[];
189
+
190
+ declare function stylistic(): FlatESLintConfigItem[];
191
+
192
+ declare function test(options?: OptionsIsInEditor & OptionsOverrides): FlatESLintConfigItem[];
193
+
194
+ declare function typescript(options?: OptionsComponentExts & OptionsOverrides & OptionsTypeScriptWithTypes & OptionsTypeScriptParserOptions): FlatESLintConfigItem[];
195
+
196
+ declare function unicorn(options?: OptionsOverrides): FlatESLintConfigItem[];
197
+
198
+ declare function vue(options?: OptionsHasTypeScript & OptionsOverrides): FlatESLintConfigItem[];
199
+
200
+ declare function yaml(options?: OptionsOverrides): FlatESLintConfigItem[];
201
+
202
+ /**
203
+ * Combine array and non-array configs into a single array.
204
+ */
205
+ declare function combineConfigs(...configs: (FlatESLintConfigItem$1 | FlatESLintConfigItem$1[])[]): FlatESLintConfigItem$1[];
206
+ declare function renameRules(rules: Record<string, any>, from: string, to: string): {
207
+ [k: string]: any;
208
+ };
209
+
210
+ declare const GLOB_JS = "**/*.?([cm])js";
211
+ declare const GLOB_JSX = "**/*.?([cm])jsx";
212
+ declare const GLOB_TS = "**/*.?([cm])ts";
213
+ declare const GLOB_TSX = "**/*.?([cm])tsx";
214
+ declare const GLOB_EXCLUDE: string[];
215
+ declare const GLOB_SRC = "**/*.?([cm])[jt]s?(x)";
216
+ declare const GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
217
+ declare const GLOB_TESTS: string[];
218
+ declare const GLOB_VUE = "**/*.vue";
219
+ declare const GLOB_JSON = "**/*.json";
220
+ declare const GLOB_JSON5 = "**/*.json5";
221
+ declare const GLOB_JSONC = "**/*.jsonc";
222
+ declare const GLOB_YAML = "**/*.y?(a)ml";
223
+ declare const GLOB_MARKDOWN = "**/*.md";
224
+ declare const GLOB_MARKDOWN_CODE = "**/*.md/**/*.?([cm])[jt]s?(x)";
225
+
226
+ export { FlatESLintConfigItem, GLOB_EXCLUDE, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_SRC, GLOB_SRC_EXT, GLOB_TESTS, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, OptionsComponentExts, OptionsConfig, OptionsHasTypeScript, OptionsIgnores, OptionsIsInEditor, OptionsOverrides, OptionsTypeScriptParserOptions, OptionsTypeScriptWithTypes, combineConfigs, comments, vinicuncaESLint as default, ignores, imports, javascript, jsdoc, jsonc, markdown, node, react, renameRules, sortPackageJson, sortTsconfig, stylistic, test, typescript, unicorn, vinicuncaESLint, vue, yaml };