@jsse/eslint-config 0.0.3 → 0.0.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.
- package/LICENSE +21 -21
- package/dist/cli.cjs +36 -15
- package/dist/cli.js +9 -6
- package/dist/index.cjs +9585 -478
- package/dist/index.d.cts +140 -1
- package/dist/index.d.ts +140 -1
- package/dist/index.js +9473 -311
- package/package.json +12 -12
package/dist/index.d.cts
CHANGED
|
@@ -41,6 +41,15 @@ type ConfigItem = Omit<FlatESLintConfigItem<Rules, false>, "plugins"> & {
|
|
|
41
41
|
*/
|
|
42
42
|
plugins?: Record<string, any>;
|
|
43
43
|
};
|
|
44
|
+
type OptionsCommon = {
|
|
45
|
+
debug?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* The prefix for the name of the config item.
|
|
48
|
+
*
|
|
49
|
+
* @default "jsse"
|
|
50
|
+
*/
|
|
51
|
+
rootName?: string;
|
|
52
|
+
};
|
|
44
53
|
type OptionsComponentExts = {
|
|
45
54
|
/**
|
|
46
55
|
* Additional extensions for components.
|
|
@@ -62,6 +71,7 @@ type OptionsTypeScriptWithTypes = {
|
|
|
62
71
|
* @see https://typescript-eslint.io/linting/typed-linting/
|
|
63
72
|
*/
|
|
64
73
|
tsconfigPath?: string | string[];
|
|
74
|
+
typeAware?: boolean;
|
|
65
75
|
};
|
|
66
76
|
type OptionsHasTypeScript = {
|
|
67
77
|
typescript?: boolean;
|
|
@@ -96,7 +106,10 @@ type OptionsConfig = {
|
|
|
96
106
|
*/
|
|
97
107
|
debug?: boolean;
|
|
98
108
|
tailwind?: boolean;
|
|
109
|
+
reportUnusedDisableDirectives?: boolean;
|
|
99
110
|
off?: string[];
|
|
111
|
+
fast?: boolean;
|
|
112
|
+
prettier?: boolean;
|
|
100
113
|
/**
|
|
101
114
|
* Enable gitignore support.
|
|
102
115
|
*
|
|
@@ -107,6 +120,7 @@ type OptionsConfig = {
|
|
|
107
120
|
*/
|
|
108
121
|
gitignore?: boolean | FlatGitignoreOptions;
|
|
109
122
|
tsPrefix?: string;
|
|
123
|
+
typeAware?: boolean;
|
|
110
124
|
/**
|
|
111
125
|
* Enable TypeScript support.
|
|
112
126
|
*
|
|
@@ -189,6 +203,131 @@ declare function jsonc(options?: OptionsStylistic & OptionsOverrides): ConfigIte
|
|
|
189
203
|
|
|
190
204
|
declare function node(): ConfigItem[];
|
|
191
205
|
|
|
206
|
+
/**
|
|
207
|
+
* Copied from https://raw.githubusercontent.com/prettier/eslint-config-prettier/main/index.js
|
|
208
|
+
* Main difference is we exclude rules we don't care about.... (flow/babel/etc)
|
|
209
|
+
*/
|
|
210
|
+
declare function eslintConfigPrettierRules(): ConfigItem["rules"];
|
|
211
|
+
declare function prettier(): ConfigItem[];
|
|
212
|
+
|
|
213
|
+
declare function reactRules(): {
|
|
214
|
+
"react-hooks/exhaustive-deps": string;
|
|
215
|
+
"react-hooks/rules-of-hooks": string;
|
|
216
|
+
"react/boolean-prop-naming": (string | {
|
|
217
|
+
rule: string;
|
|
218
|
+
validateNested: boolean;
|
|
219
|
+
})[];
|
|
220
|
+
"react/button-has-type": string;
|
|
221
|
+
"react/function-component-definition": (string | {
|
|
222
|
+
namedComponents: string;
|
|
223
|
+
unnamedComponents: string;
|
|
224
|
+
})[];
|
|
225
|
+
"react/hook-use-state": string;
|
|
226
|
+
"react/iframe-missing-sandbox": string;
|
|
227
|
+
"react/jsx-boolean-value": string;
|
|
228
|
+
"react/jsx-child-element-spacing": string;
|
|
229
|
+
"react/jsx-closing-bracket-location": (string | {
|
|
230
|
+
nonEmpty: string;
|
|
231
|
+
selfClosing: boolean;
|
|
232
|
+
})[];
|
|
233
|
+
"react/jsx-closing-tag-location": string;
|
|
234
|
+
"react/jsx-curly-brace-presence": (string | {
|
|
235
|
+
children: string;
|
|
236
|
+
propElementValues: string;
|
|
237
|
+
props: string;
|
|
238
|
+
})[];
|
|
239
|
+
"react/jsx-curly-newline": (string | {
|
|
240
|
+
multiline: string;
|
|
241
|
+
singleline: string;
|
|
242
|
+
})[];
|
|
243
|
+
"react/jsx-curly-spacing": string[];
|
|
244
|
+
"react/jsx-equals-spacing": string[];
|
|
245
|
+
"react/jsx-first-prop-new-line": string;
|
|
246
|
+
"react/jsx-fragments": string[];
|
|
247
|
+
"react/jsx-indent": (string | number)[];
|
|
248
|
+
"react/jsx-indent-props": (string | number)[];
|
|
249
|
+
"react/jsx-key": string;
|
|
250
|
+
"react/jsx-max-props-per-line": (string | {
|
|
251
|
+
maximum: number;
|
|
252
|
+
when: string;
|
|
253
|
+
})[];
|
|
254
|
+
"react/jsx-no-bind": (string | {
|
|
255
|
+
allowArrowFunctions: boolean;
|
|
256
|
+
})[];
|
|
257
|
+
"react/jsx-no-comment-textnodes": string;
|
|
258
|
+
"react/jsx-no-constructed-context-values": string;
|
|
259
|
+
"react/jsx-no-duplicate-props": (string | {
|
|
260
|
+
ignoreCase: boolean;
|
|
261
|
+
})[];
|
|
262
|
+
"react/jsx-no-script-url": string;
|
|
263
|
+
"react/jsx-no-target-blank": (string | {
|
|
264
|
+
forms: boolean;
|
|
265
|
+
warnOnSpreadAttributes: boolean;
|
|
266
|
+
})[];
|
|
267
|
+
"react/jsx-no-undef": string;
|
|
268
|
+
"react/jsx-no-useless-fragment": string;
|
|
269
|
+
"react/jsx-pascal-case": string;
|
|
270
|
+
"react/jsx-props-no-multi-spaces": string;
|
|
271
|
+
"react/jsx-sort-props": (string | {
|
|
272
|
+
callbacksLast: boolean;
|
|
273
|
+
noSortAlphabetically: boolean;
|
|
274
|
+
reservedFirst: boolean;
|
|
275
|
+
shorthandFirst: boolean;
|
|
276
|
+
})[];
|
|
277
|
+
"react/jsx-tag-spacing": (string | {
|
|
278
|
+
afterOpening: string;
|
|
279
|
+
beforeClosing: string;
|
|
280
|
+
beforeSelfClosing: string;
|
|
281
|
+
closingSlash: string;
|
|
282
|
+
})[];
|
|
283
|
+
"react/jsx-uses-react": string;
|
|
284
|
+
"react/jsx-uses-vars": string;
|
|
285
|
+
"react/jsx-wrap-multilines": (string | {
|
|
286
|
+
arrow: string;
|
|
287
|
+
assignment: string;
|
|
288
|
+
condition: string;
|
|
289
|
+
declaration: string;
|
|
290
|
+
logical: string;
|
|
291
|
+
prop: string;
|
|
292
|
+
return: string;
|
|
293
|
+
})[];
|
|
294
|
+
"react/no-access-state-in-setstate": string;
|
|
295
|
+
"react/no-array-index-key": string;
|
|
296
|
+
"react/no-arrow-function-lifecycle": string;
|
|
297
|
+
"react/no-children-prop": string;
|
|
298
|
+
"react/no-danger": string;
|
|
299
|
+
"react/no-danger-with-children": string;
|
|
300
|
+
"react/no-deprecated": string;
|
|
301
|
+
"react/no-did-update-set-state": string;
|
|
302
|
+
"react/no-direct-mutation-state": string;
|
|
303
|
+
"react/no-find-dom-node": string;
|
|
304
|
+
"react/no-invalid-html-attribute": string;
|
|
305
|
+
"react/no-is-mounted": string;
|
|
306
|
+
"react/no-namespace": string;
|
|
307
|
+
"react/no-redundant-should-component-update": string;
|
|
308
|
+
"react/no-render-return-value": string;
|
|
309
|
+
"react/no-string-refs": (string | {
|
|
310
|
+
noTemplateLiterals: boolean;
|
|
311
|
+
})[];
|
|
312
|
+
"react/no-this-in-sfc": string;
|
|
313
|
+
"react/no-typos": string;
|
|
314
|
+
"react/no-unescaped-entities": string;
|
|
315
|
+
"react/no-unsafe": string;
|
|
316
|
+
"react/no-unused-state": string;
|
|
317
|
+
"react/prefer-read-only-props": string;
|
|
318
|
+
"react/react-in-jsx-scope": string;
|
|
319
|
+
"react/require-default-props": (string | {
|
|
320
|
+
forbidDefaultForRequired: boolean;
|
|
321
|
+
ignoreFunctionalComponents: boolean;
|
|
322
|
+
})[];
|
|
323
|
+
"react/self-closing-comp": string;
|
|
324
|
+
"react/state-in-constructor": string[];
|
|
325
|
+
"react/static-property-placement": string;
|
|
326
|
+
"react/style-prop-object": (string | {
|
|
327
|
+
allow: string[];
|
|
328
|
+
})[];
|
|
329
|
+
"react/void-dom-elements-no-children": string;
|
|
330
|
+
};
|
|
192
331
|
declare function reactHooks(): {
|
|
193
332
|
files: string[];
|
|
194
333
|
plugins: {
|
|
@@ -257,4 +396,4 @@ declare function isInEditor(): boolean;
|
|
|
257
396
|
declare function jssestd(): ConfigItem[];
|
|
258
397
|
declare function jsseReact(): ConfigItem[];
|
|
259
398
|
|
|
260
|
-
export { ConfigItem, GLOB_ALL_SRC, GLOB_CSS, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TESTS, GLOB_TS, GLOB_TSX, GLOB_YAML, OptionsComponentExts, OptionsConfig, OptionsHasTypeScript, OptionsIsInEditor, OptionsOverrides, OptionsPrefix, OptionsReact, OptionsStylistic, OptionsTypeScriptParserOptions, OptionsTypeScriptWithTypes, Rules, StylisticConfig, combine, comments, jsse as default, ignores, imports, isCI, isInEditor, javascript, jsdoc, jsonc, jsse, jsseReact, jssestd, node, react, reactHooks, renameRules, sortPackageJson, sortTsconfig, test, typescript, unicorn };
|
|
399
|
+
export { ConfigItem, GLOB_ALL_SRC, GLOB_CSS, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TESTS, GLOB_TS, GLOB_TSX, GLOB_YAML, OptionsCommon, OptionsComponentExts, OptionsConfig, OptionsHasTypeScript, OptionsIsInEditor, OptionsOverrides, OptionsPrefix, OptionsReact, OptionsStylistic, OptionsTypeScriptParserOptions, OptionsTypeScriptWithTypes, Rules, StylisticConfig, combine, comments, jsse as default, eslintConfigPrettierRules, ignores, imports, isCI, isInEditor, javascript, jsdoc, jsonc, jsse, jsseReact, jssestd, node, prettier, react, reactHooks, reactRules, renameRules, sortPackageJson, sortTsconfig, test, typescript, unicorn };
|
package/dist/index.d.ts
CHANGED
|
@@ -41,6 +41,15 @@ type ConfigItem = Omit<FlatESLintConfigItem<Rules, false>, "plugins"> & {
|
|
|
41
41
|
*/
|
|
42
42
|
plugins?: Record<string, any>;
|
|
43
43
|
};
|
|
44
|
+
type OptionsCommon = {
|
|
45
|
+
debug?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* The prefix for the name of the config item.
|
|
48
|
+
*
|
|
49
|
+
* @default "jsse"
|
|
50
|
+
*/
|
|
51
|
+
rootName?: string;
|
|
52
|
+
};
|
|
44
53
|
type OptionsComponentExts = {
|
|
45
54
|
/**
|
|
46
55
|
* Additional extensions for components.
|
|
@@ -62,6 +71,7 @@ type OptionsTypeScriptWithTypes = {
|
|
|
62
71
|
* @see https://typescript-eslint.io/linting/typed-linting/
|
|
63
72
|
*/
|
|
64
73
|
tsconfigPath?: string | string[];
|
|
74
|
+
typeAware?: boolean;
|
|
65
75
|
};
|
|
66
76
|
type OptionsHasTypeScript = {
|
|
67
77
|
typescript?: boolean;
|
|
@@ -96,7 +106,10 @@ type OptionsConfig = {
|
|
|
96
106
|
*/
|
|
97
107
|
debug?: boolean;
|
|
98
108
|
tailwind?: boolean;
|
|
109
|
+
reportUnusedDisableDirectives?: boolean;
|
|
99
110
|
off?: string[];
|
|
111
|
+
fast?: boolean;
|
|
112
|
+
prettier?: boolean;
|
|
100
113
|
/**
|
|
101
114
|
* Enable gitignore support.
|
|
102
115
|
*
|
|
@@ -107,6 +120,7 @@ type OptionsConfig = {
|
|
|
107
120
|
*/
|
|
108
121
|
gitignore?: boolean | FlatGitignoreOptions;
|
|
109
122
|
tsPrefix?: string;
|
|
123
|
+
typeAware?: boolean;
|
|
110
124
|
/**
|
|
111
125
|
* Enable TypeScript support.
|
|
112
126
|
*
|
|
@@ -189,6 +203,131 @@ declare function jsonc(options?: OptionsStylistic & OptionsOverrides): ConfigIte
|
|
|
189
203
|
|
|
190
204
|
declare function node(): ConfigItem[];
|
|
191
205
|
|
|
206
|
+
/**
|
|
207
|
+
* Copied from https://raw.githubusercontent.com/prettier/eslint-config-prettier/main/index.js
|
|
208
|
+
* Main difference is we exclude rules we don't care about.... (flow/babel/etc)
|
|
209
|
+
*/
|
|
210
|
+
declare function eslintConfigPrettierRules(): ConfigItem["rules"];
|
|
211
|
+
declare function prettier(): ConfigItem[];
|
|
212
|
+
|
|
213
|
+
declare function reactRules(): {
|
|
214
|
+
"react-hooks/exhaustive-deps": string;
|
|
215
|
+
"react-hooks/rules-of-hooks": string;
|
|
216
|
+
"react/boolean-prop-naming": (string | {
|
|
217
|
+
rule: string;
|
|
218
|
+
validateNested: boolean;
|
|
219
|
+
})[];
|
|
220
|
+
"react/button-has-type": string;
|
|
221
|
+
"react/function-component-definition": (string | {
|
|
222
|
+
namedComponents: string;
|
|
223
|
+
unnamedComponents: string;
|
|
224
|
+
})[];
|
|
225
|
+
"react/hook-use-state": string;
|
|
226
|
+
"react/iframe-missing-sandbox": string;
|
|
227
|
+
"react/jsx-boolean-value": string;
|
|
228
|
+
"react/jsx-child-element-spacing": string;
|
|
229
|
+
"react/jsx-closing-bracket-location": (string | {
|
|
230
|
+
nonEmpty: string;
|
|
231
|
+
selfClosing: boolean;
|
|
232
|
+
})[];
|
|
233
|
+
"react/jsx-closing-tag-location": string;
|
|
234
|
+
"react/jsx-curly-brace-presence": (string | {
|
|
235
|
+
children: string;
|
|
236
|
+
propElementValues: string;
|
|
237
|
+
props: string;
|
|
238
|
+
})[];
|
|
239
|
+
"react/jsx-curly-newline": (string | {
|
|
240
|
+
multiline: string;
|
|
241
|
+
singleline: string;
|
|
242
|
+
})[];
|
|
243
|
+
"react/jsx-curly-spacing": string[];
|
|
244
|
+
"react/jsx-equals-spacing": string[];
|
|
245
|
+
"react/jsx-first-prop-new-line": string;
|
|
246
|
+
"react/jsx-fragments": string[];
|
|
247
|
+
"react/jsx-indent": (string | number)[];
|
|
248
|
+
"react/jsx-indent-props": (string | number)[];
|
|
249
|
+
"react/jsx-key": string;
|
|
250
|
+
"react/jsx-max-props-per-line": (string | {
|
|
251
|
+
maximum: number;
|
|
252
|
+
when: string;
|
|
253
|
+
})[];
|
|
254
|
+
"react/jsx-no-bind": (string | {
|
|
255
|
+
allowArrowFunctions: boolean;
|
|
256
|
+
})[];
|
|
257
|
+
"react/jsx-no-comment-textnodes": string;
|
|
258
|
+
"react/jsx-no-constructed-context-values": string;
|
|
259
|
+
"react/jsx-no-duplicate-props": (string | {
|
|
260
|
+
ignoreCase: boolean;
|
|
261
|
+
})[];
|
|
262
|
+
"react/jsx-no-script-url": string;
|
|
263
|
+
"react/jsx-no-target-blank": (string | {
|
|
264
|
+
forms: boolean;
|
|
265
|
+
warnOnSpreadAttributes: boolean;
|
|
266
|
+
})[];
|
|
267
|
+
"react/jsx-no-undef": string;
|
|
268
|
+
"react/jsx-no-useless-fragment": string;
|
|
269
|
+
"react/jsx-pascal-case": string;
|
|
270
|
+
"react/jsx-props-no-multi-spaces": string;
|
|
271
|
+
"react/jsx-sort-props": (string | {
|
|
272
|
+
callbacksLast: boolean;
|
|
273
|
+
noSortAlphabetically: boolean;
|
|
274
|
+
reservedFirst: boolean;
|
|
275
|
+
shorthandFirst: boolean;
|
|
276
|
+
})[];
|
|
277
|
+
"react/jsx-tag-spacing": (string | {
|
|
278
|
+
afterOpening: string;
|
|
279
|
+
beforeClosing: string;
|
|
280
|
+
beforeSelfClosing: string;
|
|
281
|
+
closingSlash: string;
|
|
282
|
+
})[];
|
|
283
|
+
"react/jsx-uses-react": string;
|
|
284
|
+
"react/jsx-uses-vars": string;
|
|
285
|
+
"react/jsx-wrap-multilines": (string | {
|
|
286
|
+
arrow: string;
|
|
287
|
+
assignment: string;
|
|
288
|
+
condition: string;
|
|
289
|
+
declaration: string;
|
|
290
|
+
logical: string;
|
|
291
|
+
prop: string;
|
|
292
|
+
return: string;
|
|
293
|
+
})[];
|
|
294
|
+
"react/no-access-state-in-setstate": string;
|
|
295
|
+
"react/no-array-index-key": string;
|
|
296
|
+
"react/no-arrow-function-lifecycle": string;
|
|
297
|
+
"react/no-children-prop": string;
|
|
298
|
+
"react/no-danger": string;
|
|
299
|
+
"react/no-danger-with-children": string;
|
|
300
|
+
"react/no-deprecated": string;
|
|
301
|
+
"react/no-did-update-set-state": string;
|
|
302
|
+
"react/no-direct-mutation-state": string;
|
|
303
|
+
"react/no-find-dom-node": string;
|
|
304
|
+
"react/no-invalid-html-attribute": string;
|
|
305
|
+
"react/no-is-mounted": string;
|
|
306
|
+
"react/no-namespace": string;
|
|
307
|
+
"react/no-redundant-should-component-update": string;
|
|
308
|
+
"react/no-render-return-value": string;
|
|
309
|
+
"react/no-string-refs": (string | {
|
|
310
|
+
noTemplateLiterals: boolean;
|
|
311
|
+
})[];
|
|
312
|
+
"react/no-this-in-sfc": string;
|
|
313
|
+
"react/no-typos": string;
|
|
314
|
+
"react/no-unescaped-entities": string;
|
|
315
|
+
"react/no-unsafe": string;
|
|
316
|
+
"react/no-unused-state": string;
|
|
317
|
+
"react/prefer-read-only-props": string;
|
|
318
|
+
"react/react-in-jsx-scope": string;
|
|
319
|
+
"react/require-default-props": (string | {
|
|
320
|
+
forbidDefaultForRequired: boolean;
|
|
321
|
+
ignoreFunctionalComponents: boolean;
|
|
322
|
+
})[];
|
|
323
|
+
"react/self-closing-comp": string;
|
|
324
|
+
"react/state-in-constructor": string[];
|
|
325
|
+
"react/static-property-placement": string;
|
|
326
|
+
"react/style-prop-object": (string | {
|
|
327
|
+
allow: string[];
|
|
328
|
+
})[];
|
|
329
|
+
"react/void-dom-elements-no-children": string;
|
|
330
|
+
};
|
|
192
331
|
declare function reactHooks(): {
|
|
193
332
|
files: string[];
|
|
194
333
|
plugins: {
|
|
@@ -257,4 +396,4 @@ declare function isInEditor(): boolean;
|
|
|
257
396
|
declare function jssestd(): ConfigItem[];
|
|
258
397
|
declare function jsseReact(): ConfigItem[];
|
|
259
398
|
|
|
260
|
-
export { ConfigItem, GLOB_ALL_SRC, GLOB_CSS, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TESTS, GLOB_TS, GLOB_TSX, GLOB_YAML, OptionsComponentExts, OptionsConfig, OptionsHasTypeScript, OptionsIsInEditor, OptionsOverrides, OptionsPrefix, OptionsReact, OptionsStylistic, OptionsTypeScriptParserOptions, OptionsTypeScriptWithTypes, Rules, StylisticConfig, combine, comments, jsse as default, ignores, imports, isCI, isInEditor, javascript, jsdoc, jsonc, jsse, jsseReact, jssestd, node, react, reactHooks, renameRules, sortPackageJson, sortTsconfig, test, typescript, unicorn };
|
|
399
|
+
export { ConfigItem, GLOB_ALL_SRC, GLOB_CSS, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TESTS, GLOB_TS, GLOB_TSX, GLOB_YAML, OptionsCommon, OptionsComponentExts, OptionsConfig, OptionsHasTypeScript, OptionsIsInEditor, OptionsOverrides, OptionsPrefix, OptionsReact, OptionsStylistic, OptionsTypeScriptParserOptions, OptionsTypeScriptWithTypes, Rules, StylisticConfig, combine, comments, jsse as default, eslintConfigPrettierRules, ignores, imports, isCI, isInEditor, javascript, jsdoc, jsonc, jsse, jsseReact, jssestd, node, prettier, react, reactHooks, reactRules, renameRules, sortPackageJson, sortTsconfig, test, typescript, unicorn };
|