@jsse/eslint-config 0.2.19 → 0.2.21
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/README.md +1 -1
- package/dist/cli.cjs +1 -1
- package/dist/cli.js +1 -1
- package/dist/esm/cli.d.ts +1 -0
- package/dist/esm/cli.js +96 -0
- package/dist/esm/cli.js.map +1 -0
- package/dist/esm/config-fns.d.ts +56 -0
- package/dist/esm/config-fns.js +76 -0
- package/dist/esm/config-fns.js.map +1 -0
- package/dist/esm/configs/antfu.d.ts +4 -0
- package/dist/esm/configs/antfu.js +31 -0
- package/dist/esm/configs/antfu.js.map +1 -0
- package/dist/esm/configs/comments.d.ts +2 -0
- package/dist/esm/configs/comments.js +17 -0
- package/dist/esm/configs/comments.js.map +1 -0
- package/dist/esm/configs/gql.d.ts +2 -0
- package/dist/esm/configs/gql.js +5 -0
- package/dist/esm/configs/gql.js.map +1 -0
- package/dist/esm/configs/ignores.d.ts +2 -0
- package/dist/esm/configs/ignores.js +10 -0
- package/dist/esm/configs/ignores.js.map +1 -0
- package/dist/esm/configs/imports.d.ts +2 -0
- package/dist/esm/configs/imports.js +30 -0
- package/dist/esm/configs/imports.js.map +1 -0
- package/dist/esm/configs/javascript.d.ts +6 -0
- package/dist/esm/configs/javascript.js +263 -0
- package/dist/esm/configs/javascript.js.map +1 -0
- package/dist/esm/configs/jsdoc.d.ts +2 -0
- package/dist/esm/configs/jsdoc.js +32 -0
- package/dist/esm/configs/jsdoc.js.map +1 -0
- package/dist/esm/configs/jsonc.d.ts +4 -0
- package/dist/esm/configs/jsonc.js +77 -0
- package/dist/esm/configs/jsonc.js.map +1 -0
- package/dist/esm/configs/markdown.d.ts +4 -0
- package/dist/esm/configs/markdown.js +123 -0
- package/dist/esm/configs/markdown.js.map +1 -0
- package/dist/esm/configs/n.d.ts +2 -0
- package/dist/esm/configs/n.js +22 -0
- package/dist/esm/configs/n.js.map +1 -0
- package/dist/esm/configs/no-only-tests.d.ts +4 -0
- package/dist/esm/configs/no-only-tests.js +32 -0
- package/dist/esm/configs/no-only-tests.js.map +1 -0
- package/dist/esm/configs/perfectionist.d.ts +7 -0
- package/dist/esm/configs/perfectionist.js +61 -0
- package/dist/esm/configs/perfectionist.js.map +1 -0
- package/dist/esm/configs/prettier.d.ts +7 -0
- package/dist/esm/configs/prettier.js +127 -0
- package/dist/esm/configs/prettier.js.map +1 -0
- package/dist/esm/configs/react.d.ts +6 -0
- package/dist/esm/configs/react.js +302 -0
- package/dist/esm/configs/react.js.map +1 -0
- package/dist/esm/configs/sort-package-json.d.ts +7 -0
- package/dist/esm/configs/sort-package-json.js +90 -0
- package/dist/esm/configs/sort-package-json.js.map +1 -0
- package/dist/esm/configs/sort-tsconfig.d.ts +14 -0
- package/dist/esm/configs/sort-tsconfig.js +134 -0
- package/dist/esm/configs/sort-tsconfig.js.map +1 -0
- package/dist/esm/configs/stylistic.d.ts +2 -0
- package/dist/esm/configs/stylistic.js +38 -0
- package/dist/esm/configs/stylistic.js.map +1 -0
- package/dist/esm/configs/tailwind.d.ts +2 -0
- package/dist/esm/configs/tailwind.js +49 -0
- package/dist/esm/configs/tailwind.js.map +1 -0
- package/dist/esm/configs/toml.d.ts +2 -0
- package/dist/esm/configs/toml.js +51 -0
- package/dist/esm/configs/toml.js.map +1 -0
- package/dist/esm/configs/ts/parser.d.ts +7 -0
- package/dist/esm/configs/ts/parser.js +66 -0
- package/dist/esm/configs/ts/parser.js.map +1 -0
- package/dist/esm/configs/ts/requires-type-checking.d.ts +1 -0
- package/dist/esm/configs/ts/requires-type-checking.js +58 -0
- package/dist/esm/configs/ts/requires-type-checking.js.map +1 -0
- package/dist/esm/configs/ts/typescript-language-options.d.ts +2 -0
- package/dist/esm/configs/ts/typescript-language-options.js +23 -0
- package/dist/esm/configs/ts/typescript-language-options.js.map +1 -0
- package/dist/esm/configs/ts/typescript-rules.d.ts +6 -0
- package/dist/esm/configs/ts/typescript-rules.js +416 -0
- package/dist/esm/configs/ts/typescript-rules.js.map +1 -0
- package/dist/esm/configs/ts/typescript.d.ts +4 -0
- package/dist/esm/configs/ts/typescript.js +110 -0
- package/dist/esm/configs/ts/typescript.js.map +1 -0
- package/dist/esm/configs/tsdoc.d.ts +2 -0
- package/dist/esm/configs/tsdoc.js +17 -0
- package/dist/esm/configs/tsdoc.js.map +1 -0
- package/dist/esm/configs/unicorn.d.ts +2 -0
- package/dist/esm/configs/unicorn.js +116 -0
- package/dist/esm/configs/unicorn.js.map +1 -0
- package/dist/esm/configs/vitest.d.ts +4 -0
- package/dist/esm/configs/vitest.js +30 -0
- package/dist/esm/configs/vitest.js.map +1 -0
- package/dist/esm/configs/yml.d.ts +4 -0
- package/dist/esm/configs/yml.js +52 -0
- package/dist/esm/configs/yml.js.map +1 -0
- package/dist/esm/const.d.ts +5 -0
- package/dist/esm/const.js +12 -0
- package/dist/esm/const.js.map +1 -0
- package/dist/esm/define-config.d.ts +7 -0
- package/dist/esm/define-config.js +234 -0
- package/dist/esm/define-config.js.map +1 -0
- package/dist/esm/dev.d.ts +4 -0
- package/dist/esm/dev.js +26 -0
- package/dist/esm/dev.js.map +1 -0
- package/dist/esm/fixable.d.ts +1 -0
- package/dist/esm/fixable.js +390 -0
- package/dist/esm/fixable.js.map +1 -0
- package/dist/esm/globs.d.ts +25 -0
- package/dist/esm/globs.js +74 -0
- package/dist/esm/globs.js.map +1 -0
- package/dist/esm/index.d.ts +8 -0
- package/dist/esm/index.js +9 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/lager.d.ts +31 -0
- package/dist/esm/lager.js +87 -0
- package/dist/esm/lager.js.map +1 -0
- package/dist/esm/plugindex.d.ts +7 -0
- package/dist/esm/plugindex.js +61 -0
- package/dist/esm/plugindex.js.map +1 -0
- package/dist/esm/plugins-all.d.ts +23 -0
- package/dist/esm/plugins-all.js +27 -0
- package/dist/esm/plugins-all.js.map +1 -0
- package/dist/esm/plugins.d.ts +983 -0
- package/dist/esm/plugins.js +113 -0
- package/dist/esm/plugins.js.map +1 -0
- package/dist/esm/presets.d.ts +2 -0
- package/dist/esm/presets.js +13 -0
- package/dist/esm/presets.js.map +1 -0
- package/dist/esm/types.d.ts +255 -0
- package/dist/esm/types.js +2 -0
- package/dist/esm/types.js.map +1 -0
- package/dist/esm/utils.d.ts +51 -0
- package/dist/esm/utils.js +157 -0
- package/dist/esm/utils.js.map +1 -0
- package/dist/index.cjs +908 -307
- package/dist/index.d.cts +207 -25
- package/dist/index.d.ts +207 -25
- package/dist/index.js +909 -315
- package/package.json +23 -14
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { pluginPerfectionist } from "../plugins.js";
|
|
2
|
+
/**
|
|
3
|
+
* Optional perfectionist plugin for props and items sorting.
|
|
4
|
+
*
|
|
5
|
+
* @see https://github.com/azat-io/eslint-plugin-perfectionist
|
|
6
|
+
*/
|
|
7
|
+
export const perfectionist = async () => {
|
|
8
|
+
return [
|
|
9
|
+
{
|
|
10
|
+
name: "jsse/perfectionist",
|
|
11
|
+
plugins: {
|
|
12
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
13
|
+
perfectionist: pluginPerfectionist,
|
|
14
|
+
},
|
|
15
|
+
rules: {
|
|
16
|
+
"perfectionist/sort-exports": [
|
|
17
|
+
"error",
|
|
18
|
+
{ order: "asc", type: "natural" },
|
|
19
|
+
],
|
|
20
|
+
"perfectionist/sort-imports": [
|
|
21
|
+
"error",
|
|
22
|
+
{
|
|
23
|
+
customGroups: {
|
|
24
|
+
type: {
|
|
25
|
+
react: ["react", "react-*", "react-*/*"],
|
|
26
|
+
},
|
|
27
|
+
value: {
|
|
28
|
+
react: ["react", "react-*", "react-*/*"],
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
groups: [
|
|
32
|
+
"react", // react and react-* packages come first if they exist
|
|
33
|
+
"type",
|
|
34
|
+
"builtin",
|
|
35
|
+
"external",
|
|
36
|
+
"internal-type",
|
|
37
|
+
"internal",
|
|
38
|
+
["parent-type", "sibling-type", "index-type"],
|
|
39
|
+
["parent", "sibling", "index"],
|
|
40
|
+
"object",
|
|
41
|
+
"unknown",
|
|
42
|
+
],
|
|
43
|
+
internalPattern: ["~/**", "@/**"],
|
|
44
|
+
newlinesBetween: "ignore",
|
|
45
|
+
order: "asc",
|
|
46
|
+
type: "natural",
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
|
+
"perfectionist/sort-named-exports": [
|
|
50
|
+
"error",
|
|
51
|
+
{ order: "asc", type: "natural" },
|
|
52
|
+
],
|
|
53
|
+
"perfectionist/sort-named-imports": [
|
|
54
|
+
"error",
|
|
55
|
+
{ order: "asc", type: "natural" },
|
|
56
|
+
],
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
];
|
|
60
|
+
};
|
|
61
|
+
//# sourceMappingURL=perfectionist.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"perfectionist.js","sourceRoot":"","sources":["../../../src/configs/perfectionist.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAEpD;;;;GAIG;AACH,MAAM,CAAC,MAAM,aAAa,GAAmB,KAAK,IAAI,EAAE;IACtD,OAAO;QACL;YACE,IAAI,EAAE,oBAAoB;YAC1B,OAAO,EAAE;gBACP,mEAAmE;gBACnE,aAAa,EAAE,mBAAmB;aACnC;YACD,KAAK,EAAE;gBACL,4BAA4B,EAAE;oBAC5B,OAAO;oBACP,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE;iBAClC;gBACD,4BAA4B,EAAE;oBAC5B,OAAO;oBACP;wBACE,YAAY,EAAE;4BACZ,IAAI,EAAE;gCACJ,KAAK,EAAE,CAAC,OAAO,EAAE,SAAS,EAAE,WAAW,CAAC;6BACzC;4BACD,KAAK,EAAE;gCACL,KAAK,EAAE,CAAC,OAAO,EAAE,SAAS,EAAE,WAAW,CAAC;6BACzC;yBACF;wBACD,MAAM,EAAE;4BACN,OAAO,EAAE,sDAAsD;4BAC/D,MAAM;4BACN,SAAS;4BACT,UAAU;4BACV,eAAe;4BACf,UAAU;4BACV,CAAC,aAAa,EAAE,cAAc,EAAE,YAAY,CAAC;4BAC7C,CAAC,QAAQ,EAAE,SAAS,EAAE,OAAO,CAAC;4BAC9B,QAAQ;4BACR,SAAS;yBACV;wBACD,eAAe,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;wBACjC,eAAe,EAAE,QAAQ;wBACzB,KAAK,EAAE,KAAK;wBACZ,IAAI,EAAE,SAAS;qBAChB;iBACF;gBACD,kCAAkC,EAAE;oBAClC,OAAO;oBACP,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE;iBAClC;gBACD,kCAAkC,EAAE;oBAClC,OAAO;oBACP,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE;iBAClC;aACF;SACF;KACF,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { EslintConfigFn, TypedFlatConfigItem } from "../types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Copied from https://raw.githubusercontent.com/prettier/eslint-config-prettier/main/index.js
|
|
4
|
+
* Main difference is we exclude rules we don't care about.... (flow/babel/etc)
|
|
5
|
+
*/
|
|
6
|
+
export declare function eslintConfigPrettierRules(): TypedFlatConfigItem["rules"];
|
|
7
|
+
export declare const prettier: EslintConfigFn;
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copied from https://raw.githubusercontent.com/prettier/eslint-config-prettier/main/index.js
|
|
3
|
+
* Main difference is we exclude rules we don't care about.... (flow/babel/etc)
|
|
4
|
+
*/
|
|
5
|
+
export function eslintConfigPrettierRules() {
|
|
6
|
+
return {
|
|
7
|
+
"@typescript-eslint/block-spacing": "off",
|
|
8
|
+
"@typescript-eslint/brace-style": "off",
|
|
9
|
+
"@typescript-eslint/comma-dangle": "off",
|
|
10
|
+
"@typescript-eslint/comma-spacing": "off",
|
|
11
|
+
"@typescript-eslint/func-call-spacing": "off",
|
|
12
|
+
"@typescript-eslint/indent": "off",
|
|
13
|
+
"@typescript-eslint/key-spacing": "off",
|
|
14
|
+
"@typescript-eslint/keyword-spacing": "off",
|
|
15
|
+
"@typescript-eslint/lines-around-comment": 0,
|
|
16
|
+
"@typescript-eslint/member-delimiter-style": "off",
|
|
17
|
+
"@typescript-eslint/no-extra-parens": "off",
|
|
18
|
+
"@typescript-eslint/no-extra-semi": "off",
|
|
19
|
+
"@typescript-eslint/object-curly-spacing": "off",
|
|
20
|
+
"@typescript-eslint/quotes": 0,
|
|
21
|
+
"@typescript-eslint/semi": "off",
|
|
22
|
+
"@typescript-eslint/space-before-blocks": "off",
|
|
23
|
+
"@typescript-eslint/space-before-function-paren": "off",
|
|
24
|
+
"@typescript-eslint/space-infix-ops": "off",
|
|
25
|
+
"@typescript-eslint/type-annotation-spacing": "off",
|
|
26
|
+
// The rest are rules that you never need to enable when using Prettier.
|
|
27
|
+
"array-bracket-newline": "off",
|
|
28
|
+
"array-bracket-spacing": "off",
|
|
29
|
+
"array-element-newline": "off",
|
|
30
|
+
"arrow-parens": "off",
|
|
31
|
+
"arrow-spacing": "off",
|
|
32
|
+
"block-spacing": "off",
|
|
33
|
+
"brace-style": "off",
|
|
34
|
+
"comma-dangle": "off",
|
|
35
|
+
"comma-spacing": "off",
|
|
36
|
+
"comma-style": "off",
|
|
37
|
+
"computed-property-spacing": "off",
|
|
38
|
+
// The following rules can be used in some cases. See the README for more
|
|
39
|
+
// information. (These are marked with `0` instead of `"off"` so that a
|
|
40
|
+
// script can distinguish them.)
|
|
41
|
+
curly: 0,
|
|
42
|
+
"dot-location": "off",
|
|
43
|
+
"eol-last": "off",
|
|
44
|
+
"func-call-spacing": "off",
|
|
45
|
+
"function-call-argument-newline": "off",
|
|
46
|
+
"function-paren-newline": "off",
|
|
47
|
+
"generator-star-spacing": "off",
|
|
48
|
+
"implicit-arrow-linebreak": "off",
|
|
49
|
+
indent: "off",
|
|
50
|
+
"jsx-quotes": "off",
|
|
51
|
+
"key-spacing": "off",
|
|
52
|
+
"keyword-spacing": "off",
|
|
53
|
+
"linebreak-style": "off",
|
|
54
|
+
"lines-around-comment": 0,
|
|
55
|
+
"max-len": 0,
|
|
56
|
+
"max-statements-per-line": "off",
|
|
57
|
+
"multiline-ternary": "off",
|
|
58
|
+
"new-parens": "off",
|
|
59
|
+
"newline-per-chained-call": "off",
|
|
60
|
+
"no-confusing-arrow": 0,
|
|
61
|
+
"no-extra-parens": "off",
|
|
62
|
+
"no-extra-semi": "off",
|
|
63
|
+
"no-floating-decimal": "off",
|
|
64
|
+
"no-mixed-operators": 0,
|
|
65
|
+
"no-mixed-spaces-and-tabs": "off",
|
|
66
|
+
"no-multi-spaces": "off",
|
|
67
|
+
"no-multiple-empty-lines": "off",
|
|
68
|
+
"no-tabs": 0,
|
|
69
|
+
"no-trailing-spaces": "off",
|
|
70
|
+
"no-unexpected-multiline": 0,
|
|
71
|
+
"no-whitespace-before-property": "off",
|
|
72
|
+
"nonblock-statement-body-position": "off",
|
|
73
|
+
"object-curly-newline": "off",
|
|
74
|
+
"object-curly-spacing": "off",
|
|
75
|
+
"object-property-newline": "off",
|
|
76
|
+
"one-var-declaration-per-line": "off",
|
|
77
|
+
"operator-linebreak": "off",
|
|
78
|
+
"padded-blocks": "off",
|
|
79
|
+
"quote-props": "off",
|
|
80
|
+
quotes: 0,
|
|
81
|
+
"react/jsx-child-element-spacing": "off",
|
|
82
|
+
"react/jsx-closing-bracket-location": "off",
|
|
83
|
+
"react/jsx-closing-tag-location": "off",
|
|
84
|
+
"react/jsx-curly-newline": "off",
|
|
85
|
+
"react/jsx-curly-spacing": "off",
|
|
86
|
+
"react/jsx-equals-spacing": "off",
|
|
87
|
+
"react/jsx-first-prop-new-line": "off",
|
|
88
|
+
"react/jsx-indent": "off",
|
|
89
|
+
"react/jsx-indent-props": "off",
|
|
90
|
+
"react/jsx-max-props-per-line": "off",
|
|
91
|
+
"react/jsx-newline": "off",
|
|
92
|
+
"react/jsx-one-expression-per-line": "off",
|
|
93
|
+
"react/jsx-props-no-multi-spaces": "off",
|
|
94
|
+
"react/jsx-tag-spacing": "off",
|
|
95
|
+
"react/jsx-wrap-multilines": "off",
|
|
96
|
+
"rest-spread-spacing": "off",
|
|
97
|
+
semi: "off",
|
|
98
|
+
"semi-spacing": "off",
|
|
99
|
+
"semi-style": "off",
|
|
100
|
+
"space-before-blocks": "off",
|
|
101
|
+
"space-before-function-paren": "off",
|
|
102
|
+
"space-in-parens": "off",
|
|
103
|
+
"space-infix-ops": "off",
|
|
104
|
+
"space-unary-ops": "off",
|
|
105
|
+
"standard/array-bracket-even-spacing": "off",
|
|
106
|
+
"standard/computed-property-even-spacing": "off",
|
|
107
|
+
"standard/object-curly-even-spacing": "off",
|
|
108
|
+
"switch-colon-spacing": "off",
|
|
109
|
+
"template-curly-spacing": "off",
|
|
110
|
+
"template-tag-spacing": "off",
|
|
111
|
+
"unicorn/empty-brace-spaces": "off",
|
|
112
|
+
"unicorn/no-nested-ternary": "off",
|
|
113
|
+
"unicorn/number-literal-case": "off",
|
|
114
|
+
"wrap-iife": "off",
|
|
115
|
+
"wrap-regex": "off",
|
|
116
|
+
"yield-star-spacing": "off",
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
export const prettier = async () => {
|
|
120
|
+
return [
|
|
121
|
+
{
|
|
122
|
+
name: "jsse/prettier/config",
|
|
123
|
+
rules: eslintConfigPrettierRules(),
|
|
124
|
+
},
|
|
125
|
+
];
|
|
126
|
+
};
|
|
127
|
+
//# sourceMappingURL=prettier.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prettier.js","sourceRoot":"","sources":["../../../src/configs/prettier.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,UAAU,yBAAyB;IACvC,OAAO;QACL,kCAAkC,EAAE,KAAK;QACzC,gCAAgC,EA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EAAE,KAAK;QACxB,qCAAqC,EAAE,KAAK;QAC5C,yCAAyC,EAAE,KAAK;QAChD,oCAAoC,EAAE,KAAK;QAC3C,sBAAsB,EAAE,KAAK;QAC7B,wBAAwB,EAAE,KAAK;QAC/B,sBAAsB,EAAE,KAAK;QAC7B,4BAA4B,EAAE,KAAK;QACnC,2BAA2B,EAAE,KAAK;QAClC,6BAA6B,EAAE,KAAK;QACpC,WAAW,EAAE,KAAK;QAClB,YAAY,EAAE,KAAK;QACnB,oBAAoB,EAAE,KAAK;KAC5B,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,QAAQ,GAAmB,KAAK,IAAI,EAAE;IACjD,OAAO;QACL;YACE,IAAI,EAAE,sBAAsB;YAC5B,KAAK,EAAE,yBAAyB,EAAE;SACnC;KACF,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { EslintConfigFn, OptionsComponentExts, OptionsOverrides, OptionsReact, OptionsTypeScriptParserOptions, OptionsTypeScriptWithTypes, TypedFlatConfigItem } from "../types.js";
|
|
2
|
+
export declare function reactRules(): TypedFlatConfigItem["rules"];
|
|
3
|
+
export declare function reactHooks(): Promise<TypedFlatConfigItem[]>;
|
|
4
|
+
type ReactOptions = OptionsComponentExts & OptionsOverrides & OptionsTypeScriptWithTypes & OptionsTypeScriptParserOptions & OptionsReact;
|
|
5
|
+
export declare const react: EslintConfigFn<ReactOptions>;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
import { fixupPluginRules } from "@eslint/compat";
|
|
2
|
+
import { GLOB_JSX, GLOB_SRC, GLOB_TSX } from "../globs.js";
|
|
3
|
+
import { importPluginReactHooks, importReactPlugins } from "../plugins.js";
|
|
4
|
+
import { typescriptLanguageOptions } from "./ts/typescript-language-options.js";
|
|
5
|
+
export function reactRules() {
|
|
6
|
+
return {
|
|
7
|
+
"react-hooks/exhaustive-deps": "error",
|
|
8
|
+
"react-hooks/rules-of-hooks": "error",
|
|
9
|
+
"react/boolean-prop-naming": [
|
|
10
|
+
"error",
|
|
11
|
+
{
|
|
12
|
+
rule: [
|
|
13
|
+
"^(is|has)[A-Z]([A-Za-z0-9]?)+",
|
|
14
|
+
"|^(debug|disabled|hidden|required|selected|highlight)$",
|
|
15
|
+
].join(""),
|
|
16
|
+
validateNested: true,
|
|
17
|
+
},
|
|
18
|
+
],
|
|
19
|
+
"react/button-has-type": "error",
|
|
20
|
+
"react/function-component-definition": [
|
|
21
|
+
"error",
|
|
22
|
+
{
|
|
23
|
+
namedComponents: "function-declaration",
|
|
24
|
+
unnamedComponents: "arrow-function",
|
|
25
|
+
},
|
|
26
|
+
],
|
|
27
|
+
"react/hook-use-state": "error",
|
|
28
|
+
"react/iframe-missing-sandbox": "error",
|
|
29
|
+
"react/jsx-boolean-value": "error",
|
|
30
|
+
"react/jsx-child-element-spacing": "error",
|
|
31
|
+
"react/jsx-closing-bracket-location": [
|
|
32
|
+
"error",
|
|
33
|
+
{
|
|
34
|
+
nonEmpty: "tag-aligned",
|
|
35
|
+
selfClosing: false,
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
"react/jsx-closing-tag-location": "error",
|
|
39
|
+
"react/jsx-curly-brace-presence": [
|
|
40
|
+
"error",
|
|
41
|
+
{
|
|
42
|
+
children: "never",
|
|
43
|
+
propElementValues: "always",
|
|
44
|
+
props: "never",
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
"react/jsx-curly-newline": [
|
|
48
|
+
"error",
|
|
49
|
+
{
|
|
50
|
+
multiline: "consistent",
|
|
51
|
+
singleline: "forbid",
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
"react/jsx-curly-spacing": ["error", "never"],
|
|
55
|
+
"react/jsx-equals-spacing": ["error", "never"],
|
|
56
|
+
"react/jsx-first-prop-new-line": "error",
|
|
57
|
+
"react/jsx-fragments": ["error", "syntax"],
|
|
58
|
+
"react/jsx-indent": ["error", 2],
|
|
59
|
+
"react/jsx-indent-props": ["error", 2],
|
|
60
|
+
"react/jsx-key": "warn",
|
|
61
|
+
"react/jsx-max-props-per-line": [
|
|
62
|
+
"error",
|
|
63
|
+
{
|
|
64
|
+
maximum: 3,
|
|
65
|
+
when: "multiline",
|
|
66
|
+
},
|
|
67
|
+
],
|
|
68
|
+
"react/jsx-no-bind": [
|
|
69
|
+
"error",
|
|
70
|
+
{
|
|
71
|
+
allowArrowFunctions: true,
|
|
72
|
+
},
|
|
73
|
+
],
|
|
74
|
+
"react/jsx-no-comment-textnodes": "error",
|
|
75
|
+
"react/jsx-no-constructed-context-values": "error",
|
|
76
|
+
"react/jsx-no-duplicate-props": [
|
|
77
|
+
"error",
|
|
78
|
+
{
|
|
79
|
+
ignoreCase: true,
|
|
80
|
+
},
|
|
81
|
+
],
|
|
82
|
+
"react/jsx-no-script-url": "error",
|
|
83
|
+
"react/jsx-no-target-blank": [
|
|
84
|
+
"error",
|
|
85
|
+
{
|
|
86
|
+
allowReferrer: true,
|
|
87
|
+
forms: true,
|
|
88
|
+
warnOnSpreadAttributes: true,
|
|
89
|
+
},
|
|
90
|
+
],
|
|
91
|
+
"react/jsx-no-undef": "error",
|
|
92
|
+
"react/jsx-no-useless-fragment": "error",
|
|
93
|
+
"react/jsx-pascal-case": "error",
|
|
94
|
+
"react/jsx-props-no-multi-spaces": "error",
|
|
95
|
+
"react/jsx-sort-props": [
|
|
96
|
+
"error",
|
|
97
|
+
{
|
|
98
|
+
callbacksLast: true,
|
|
99
|
+
noSortAlphabetically: true,
|
|
100
|
+
reservedFirst: true,
|
|
101
|
+
shorthandFirst: true,
|
|
102
|
+
},
|
|
103
|
+
],
|
|
104
|
+
"react/jsx-tag-spacing": [
|
|
105
|
+
"error",
|
|
106
|
+
{
|
|
107
|
+
afterOpening: "never",
|
|
108
|
+
beforeClosing: "never",
|
|
109
|
+
beforeSelfClosing: "never",
|
|
110
|
+
closingSlash: "never",
|
|
111
|
+
},
|
|
112
|
+
],
|
|
113
|
+
"react/jsx-uses-react": "error",
|
|
114
|
+
"react/jsx-uses-vars": "error",
|
|
115
|
+
"react/jsx-wrap-multilines": [
|
|
116
|
+
"error",
|
|
117
|
+
{
|
|
118
|
+
arrow: "parens-new-line",
|
|
119
|
+
assignment: "parens-new-line",
|
|
120
|
+
condition: "ignore",
|
|
121
|
+
declaration: "parens-new-line",
|
|
122
|
+
logical: "ignore",
|
|
123
|
+
prop: "ignore",
|
|
124
|
+
return: "parens-new-line",
|
|
125
|
+
},
|
|
126
|
+
],
|
|
127
|
+
// "react/no-access-state-in-setstate": "error",
|
|
128
|
+
"react/no-array-index-key": "error",
|
|
129
|
+
"react/no-arrow-function-lifecycle": "error",
|
|
130
|
+
"react/no-children-prop": "error",
|
|
131
|
+
"react/no-danger": "error",
|
|
132
|
+
"react/no-danger-with-children": "error",
|
|
133
|
+
"react/no-deprecated": "error",
|
|
134
|
+
"react/no-did-update-set-state": "error",
|
|
135
|
+
"react/no-direct-mutation-state": "error",
|
|
136
|
+
"react/no-find-dom-node": "error",
|
|
137
|
+
"react/no-invalid-html-attribute": "error",
|
|
138
|
+
"react/no-is-mounted": "error",
|
|
139
|
+
"react/no-namespace": "error",
|
|
140
|
+
"react/no-redundant-should-component-update": "error",
|
|
141
|
+
"react/no-render-return-value": "error",
|
|
142
|
+
"react/no-string-refs": [
|
|
143
|
+
"error",
|
|
144
|
+
{
|
|
145
|
+
noTemplateLiterals: true,
|
|
146
|
+
},
|
|
147
|
+
],
|
|
148
|
+
"react/no-this-in-sfc": "error",
|
|
149
|
+
"react/no-typos": "error",
|
|
150
|
+
"react/no-unescaped-entities": "error",
|
|
151
|
+
"react/no-unsafe": "error",
|
|
152
|
+
"react/no-unstable-nested-components": "error",
|
|
153
|
+
// "react/no-unused-prop-types": "error",
|
|
154
|
+
"react/no-unused-state": "error",
|
|
155
|
+
"react/prefer-read-only-props": "error",
|
|
156
|
+
// "react/prop-types": "error",
|
|
157
|
+
"react/react-in-jsx-scope": "off", // not needed anymore!
|
|
158
|
+
"react/require-default-props": [
|
|
159
|
+
"error",
|
|
160
|
+
{
|
|
161
|
+
forbidDefaultForRequired: true,
|
|
162
|
+
ignoreFunctionalComponents: true,
|
|
163
|
+
},
|
|
164
|
+
],
|
|
165
|
+
"react/self-closing-comp": "error",
|
|
166
|
+
"react/state-in-constructor": ["error", "never"],
|
|
167
|
+
"react/static-property-placement": "error",
|
|
168
|
+
"react/style-prop-object": [
|
|
169
|
+
"error",
|
|
170
|
+
{
|
|
171
|
+
allow: ["FormattedNumber"],
|
|
172
|
+
},
|
|
173
|
+
],
|
|
174
|
+
"react/void-dom-elements-no-children": "error",
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
export async function reactHooks() {
|
|
178
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
179
|
+
const { pluginReactHooks } = await importPluginReactHooks();
|
|
180
|
+
return [
|
|
181
|
+
{
|
|
182
|
+
files: [GLOB_SRC],
|
|
183
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
184
|
+
plugins: { "react-hooks": pluginReactHooks },
|
|
185
|
+
rules: {
|
|
186
|
+
"react-hooks/exhaustive-deps": "error",
|
|
187
|
+
"react-hooks/rules-of-hooks": "error",
|
|
188
|
+
},
|
|
189
|
+
},
|
|
190
|
+
];
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Stupid prop types causes test error
|
|
194
|
+
*/
|
|
195
|
+
function reactRecomendedRules() {
|
|
196
|
+
return {
|
|
197
|
+
"react/display-name": 2,
|
|
198
|
+
"react/jsx-key": 2,
|
|
199
|
+
"react/jsx-no-comment-textnodes": 2,
|
|
200
|
+
"react/jsx-no-duplicate-props": 2,
|
|
201
|
+
"react/jsx-no-target-blank": 2,
|
|
202
|
+
"react/jsx-no-undef": 2,
|
|
203
|
+
"react/jsx-uses-react": 2,
|
|
204
|
+
"react/jsx-uses-vars": 2,
|
|
205
|
+
"react/no-children-prop": 2,
|
|
206
|
+
"react/no-danger-with-children": 2,
|
|
207
|
+
"react/no-deprecated": 2,
|
|
208
|
+
"react/no-direct-mutation-state": 2,
|
|
209
|
+
"react/no-find-dom-node": 2,
|
|
210
|
+
"react/no-is-mounted": 2,
|
|
211
|
+
"react/no-render-return-value": 2,
|
|
212
|
+
"react/no-string-refs": 2,
|
|
213
|
+
"react/no-unescaped-entities": 2,
|
|
214
|
+
// this rule has a bug w/ typescript-eslint-parser
|
|
215
|
+
// 'react/no-unknown-property': 2,
|
|
216
|
+
"react/no-unsafe": 0,
|
|
217
|
+
"react/prop-types": 1,
|
|
218
|
+
"react/react-in-jsx-scope": 2,
|
|
219
|
+
"react/require-render-return": 2,
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
export const react = async (options) => {
|
|
223
|
+
const { componentExts, parserOptions = {}, react, reactRefresh, tsconfig, } = options ?? {};
|
|
224
|
+
const reactPlugins = await importReactPlugins();
|
|
225
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
226
|
+
const { pluginReact, pluginReactHooks, pluginReactRefresh } = reactPlugins;
|
|
227
|
+
const config = [
|
|
228
|
+
{
|
|
229
|
+
files: [GLOB_SRC],
|
|
230
|
+
languageOptions: typescriptLanguageOptions({
|
|
231
|
+
componentExts,
|
|
232
|
+
parserOptions,
|
|
233
|
+
react,
|
|
234
|
+
tsconfig,
|
|
235
|
+
}),
|
|
236
|
+
name: "jsse/react/setup",
|
|
237
|
+
plugins: {
|
|
238
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
239
|
+
react: pluginReact,
|
|
240
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
241
|
+
"react-hooks": fixupPluginRules(pluginReactHooks),
|
|
242
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
243
|
+
"react-refresh": pluginReactRefresh,
|
|
244
|
+
},
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
files: [GLOB_SRC],
|
|
248
|
+
name: "jsse/react/rules",
|
|
249
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
250
|
+
rules: {
|
|
251
|
+
...reactRecomendedRules(),
|
|
252
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
253
|
+
// @ts-expect-error index access
|
|
254
|
+
...pluginReact.configs["jsx-runtime"].rules,
|
|
255
|
+
...reactRules(),
|
|
256
|
+
},
|
|
257
|
+
settings: {
|
|
258
|
+
react: {
|
|
259
|
+
version: "detect",
|
|
260
|
+
},
|
|
261
|
+
},
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
files: [GLOB_SRC],
|
|
265
|
+
name: "jsse/react-hooks/rules",
|
|
266
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
267
|
+
rules: {
|
|
268
|
+
"react-hooks/exhaustive-deps": "error",
|
|
269
|
+
"react-hooks/rules-of-hooks": "error",
|
|
270
|
+
},
|
|
271
|
+
settings: {
|
|
272
|
+
react: {
|
|
273
|
+
version: "detect",
|
|
274
|
+
},
|
|
275
|
+
},
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
files: [GLOB_JSX, GLOB_TSX],
|
|
279
|
+
name: "jsse/react/disables",
|
|
280
|
+
rules: {
|
|
281
|
+
"unicorn/no-null": "off", // null is bueno in react
|
|
282
|
+
},
|
|
283
|
+
},
|
|
284
|
+
];
|
|
285
|
+
if (reactRefresh) {
|
|
286
|
+
config.push({
|
|
287
|
+
files: [GLOB_SRC],
|
|
288
|
+
name: "jsse/react/refresh",
|
|
289
|
+
rules: {
|
|
290
|
+
"react-refresh/only-export-components": "error",
|
|
291
|
+
},
|
|
292
|
+
}, {
|
|
293
|
+
files: ["**/*.stories.tsx"],
|
|
294
|
+
name: "jsse/react-refresh/stories",
|
|
295
|
+
rules: {
|
|
296
|
+
"react-refresh/only-export-components": "off",
|
|
297
|
+
},
|
|
298
|
+
});
|
|
299
|
+
}
|
|
300
|
+
return config;
|
|
301
|
+
};
|
|
302
|
+
//# sourceMappingURL=react.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react.js","sourceRoot":"","sources":["../../../src/configs/react.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAWlD,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE3D,OAAO,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAC3E,OAAO,EAAE,yBAAyB,EAAE,MAAM,qCAAqC,CAAC;AAEhF,MAAM,UAAU,UAAU;IACxB,OAAO;QACL,6BAA6B,EAAE,OAAO;QACtC,4BAA4B,EAAE,OAAO;QACrC,2BAA2B,EAAE;YAC3B,OAAO;YACP;gBACE,IAAI,EAAE;oBACJ,+BAA+B;oBAC/B,wDAAwD;iBACzD,CAAC,IAAI,CAAC,EAAE,CAAC;gBACV,cAAc,EAAE,IAAI;aACrB;SACF;QACD,uBAAuB,EAAE,OAAO;QAChC,qCAAqC,EAAE;YACrC,OAAO;YACP;gBACE,eAAe,EAAE,sBAAsB;gBACvC,iBAAiB,EAAE,gBAAgB;aACpC;SACF;QACD,sBAAsB,EAAE,OAAO;QAC/B,8BAA8B,EAAE,OAAO;QACvC,yBAAyB,EAAE,OAAO;QAClC,iCAAiC,EAAE,OAAO;QAC1C,oCAAoC,EAAE;YACpC,OAAO;YACP;gBACE,QAAQ,EAAE,aAAa;gBACvB,WAAW,EAAE,KAAK;aACnB;SACF;QACD,gCAAgC,EAAE,OAAO;QACzC,gCAAgC,EAAE;YAChC,OAAO;YACP;gBACE,QAAQ,EAAE,OAAO;gBACjB,iBAAiB,EAAE,QAAQ;gBAC3B,KAAK,EAAE,OAAO;aACf;SACF;QACD,yBAAyB,EAAE;YACzB,OAAO;YACP;gBACE,SAAS,EAAE,YAAY;gBACvB,UAAU,EAAE,QAAQ;aACrB;SACF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AyB;aACpD;SACF;KACF,CAAC;IAEF,IAAI,YAAY,EAAE,CAAC;QACjB,MAAM,CAAC,IAAI,CACT;YACE,KAAK,EAAE,CAAC,QAAQ,CAAC;YACjB,IAAI,EAAE,oBAAoB;YAC1B,KAAK,EAAE;gBACL,sCAAsC,EAAE,OAAO;aAChD;SACF,EACD;YACE,KAAK,EAAE,CAAC,kBAAkB,CAAC;YAC3B,IAAI,EAAE,4BAA4B;YAClC,KAAK,EAAE;gBACL,sCAAsC,EAAE,KAAK;aAC9C;SACF,CACF,CAAC;IACJ,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sort package.json
|
|
3
|
+
*
|
|
4
|
+
* Requires `jsonc` config
|
|
5
|
+
*/
|
|
6
|
+
export const sortPackageJson = async () => {
|
|
7
|
+
return [
|
|
8
|
+
{
|
|
9
|
+
files: ["**/package.json"],
|
|
10
|
+
name: "jsse/sort/package-json",
|
|
11
|
+
rules: {
|
|
12
|
+
"jsonc/sort-array-values": [
|
|
13
|
+
"error",
|
|
14
|
+
{
|
|
15
|
+
order: { type: "asc" },
|
|
16
|
+
pathPattern: "^files$",
|
|
17
|
+
},
|
|
18
|
+
],
|
|
19
|
+
"jsonc/sort-keys": [
|
|
20
|
+
"error",
|
|
21
|
+
{
|
|
22
|
+
order: [
|
|
23
|
+
"publisher",
|
|
24
|
+
"name",
|
|
25
|
+
"displayName",
|
|
26
|
+
"type",
|
|
27
|
+
"version",
|
|
28
|
+
"private",
|
|
29
|
+
"packageManager",
|
|
30
|
+
"description",
|
|
31
|
+
"author",
|
|
32
|
+
"license",
|
|
33
|
+
"funding",
|
|
34
|
+
"homepage",
|
|
35
|
+
"repository",
|
|
36
|
+
"bugs",
|
|
37
|
+
"keywords",
|
|
38
|
+
"categories",
|
|
39
|
+
"sideEffects",
|
|
40
|
+
"exports",
|
|
41
|
+
"main",
|
|
42
|
+
"module",
|
|
43
|
+
"unpkg",
|
|
44
|
+
"jsdelivr",
|
|
45
|
+
"types",
|
|
46
|
+
"typesVersions",
|
|
47
|
+
"bin",
|
|
48
|
+
"icon",
|
|
49
|
+
"files",
|
|
50
|
+
"engines",
|
|
51
|
+
"activationEvents",
|
|
52
|
+
"contributes",
|
|
53
|
+
"scripts",
|
|
54
|
+
"peerDependencies",
|
|
55
|
+
"peerDependenciesMeta",
|
|
56
|
+
"dependencies",
|
|
57
|
+
"optionalDependencies",
|
|
58
|
+
"devDependencies",
|
|
59
|
+
"pnpm",
|
|
60
|
+
"overrides",
|
|
61
|
+
"resolutions",
|
|
62
|
+
"husky",
|
|
63
|
+
"simple-git-hooks",
|
|
64
|
+
"lint-staged",
|
|
65
|
+
"eslintConfig",
|
|
66
|
+
],
|
|
67
|
+
pathPattern: "^$",
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
order: { type: "asc" },
|
|
71
|
+
pathPattern: "^(?:dev|peer|optional|bundled)?[Dd]ependencies$",
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
order: { type: "asc" },
|
|
75
|
+
pathPattern: "^resolutions$",
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
order: { type: "asc" },
|
|
79
|
+
pathPattern: "^pnpm.overrides$",
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
order: ["types", "import", "require", "default"],
|
|
83
|
+
pathPattern: "^exports.*$",
|
|
84
|
+
},
|
|
85
|
+
],
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
];
|
|
89
|
+
};
|
|
90
|
+
//# sourceMappingURL=sort-package-json.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sort-package-json.js","sourceRoot":"","sources":["../../../src/configs/sort-package-json.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAmB,KAAK,IAAI,EAAE;IACxD,OAAO;QACL;YACE,KAAK,EAAE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;KACF,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { EslintConfigFn } from "../types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Sort tsconfig.json
|
|
4
|
+
*
|
|
5
|
+
* Requires `jsonc` config
|
|
6
|
+
*/
|
|
7
|
+
type SortTsconfigOptions = {
|
|
8
|
+
/**
|
|
9
|
+
* Extend files to be treated as tsconfig files
|
|
10
|
+
*/
|
|
11
|
+
extendTsconfigGlobs?: string[];
|
|
12
|
+
};
|
|
13
|
+
export declare const sortTsconfig: EslintConfigFn<SortTsconfigOptions>;
|
|
14
|
+
export {};
|