@tommy-mitchell/eslint-config-xo 0.4.0 → 0.5.0
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.js +15 -6
- package/package.json +4 -2
- package/react.js +3 -4
- package/tailwind.js +1 -0
package/index.js
CHANGED
|
@@ -1,33 +1,42 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
module.exports = {
|
|
4
|
-
plugins: ["simple-import-sort"],
|
|
4
|
+
plugins: ["perfectionist", "simple-import-sort"],
|
|
5
5
|
rules: {
|
|
6
6
|
// https://github.com/xojs/eslint-config-xo/blob/v0.44.0/index.js#L304
|
|
7
7
|
"capitalized-comments": "off",
|
|
8
|
+
"import/extensions": "off",
|
|
9
|
+
"import/order": "off",
|
|
8
10
|
// https://github.com/xojs/eslint-config-xo/blob/v0.44.0/index.js#L186
|
|
9
11
|
"no-warning-comments": ["warn", { decoration: ["/", "*"] }],
|
|
10
12
|
"object-shorthand": "off",
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
|
|
13
|
+
"perfectionist/sort-array-includes": ["error", { type: "natural" }],
|
|
14
|
+
"perfectionist/sort-maps": ["error", { type: "natural" }],
|
|
15
|
+
"perfectionist/sort-objects": ["error", { type: "natural" }],
|
|
16
|
+
// TODO: doesn't play nice with unicorn/switch-case-braces: https://github.com/azat-io/eslint-plugin-perfectionist/issues/54#issuecomment-2268283085
|
|
17
|
+
"perfectionist/sort-switch-case": ["error", { type: "natural" }],
|
|
18
|
+
"simple-import-sort/exports": "error",
|
|
14
19
|
"simple-import-sort/imports": ["error", {
|
|
15
20
|
groups: [["^\\u0000", "^node:", "^react", "^react-dom", "^@?\\w", "^", "^\\."]],
|
|
16
21
|
}],
|
|
17
|
-
"simple-import-sort/exports": "error",
|
|
18
22
|
"unicorn/prefer-regexp-test": "off",
|
|
19
23
|
"unicorn/prevent-abbreviations": "off",
|
|
20
24
|
},
|
|
21
25
|
overrides: [{
|
|
22
26
|
files: "**/*.{ts,cts,mts,tsx}",
|
|
23
27
|
settings: {
|
|
24
|
-
n: { typescriptExtensionMap: [[".ts", ".ts"]] },
|
|
28
|
+
n: { typescriptExtensionMap: [[".ts", ".ts"], [".tsx", ".tsx"]] },
|
|
25
29
|
},
|
|
26
30
|
rules: {
|
|
27
31
|
// https://github.com/xojs/eslint-config-xo-typescript/blob/v2.0.0/index.js#L384
|
|
28
32
|
"@typescript-eslint/no-confusing-void-expression": ["error", { ignoreArrowShorthand: true }],
|
|
29
33
|
// https://github.com/xojs/eslint-config-xo-typescript/blob/v2.0.0/index.js#L707
|
|
30
34
|
"@typescript-eslint/prefer-regexp-exec": "off",
|
|
35
|
+
"perfectionist/sort-enums": ["error", { type: "natural" }],
|
|
36
|
+
"perfectionist/sort-interfaces": ["error", { type: "natural" }],
|
|
37
|
+
"perfectionist/sort-intersection-types": ["error", { type: "natural" }],
|
|
38
|
+
"perfectionist/sort-object-types": ["error", { type: "natural" }],
|
|
39
|
+
"perfectionist/sort-union-types": ["error", { type: "natural" }],
|
|
31
40
|
},
|
|
32
41
|
}],
|
|
33
42
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tommy-mitchell/eslint-config-xo",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Personal config for XO.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"nodejs",
|
|
@@ -29,11 +29,13 @@
|
|
|
29
29
|
"eslint-config-xo-react": "^0.27.0",
|
|
30
30
|
"eslint-plugin-dprint-integration": "^0.3.0",
|
|
31
31
|
"eslint-plugin-jsx-a11y": "^6.9.0",
|
|
32
|
+
"eslint-plugin-perfectionist": "^3.1.3",
|
|
32
33
|
"eslint-plugin-react": "^7.35.0",
|
|
33
34
|
"eslint-plugin-react-hooks": "^4.6.2",
|
|
34
35
|
"eslint-plugin-react-refresh": "^0.4.9",
|
|
35
|
-
"eslint-plugin-readable-tailwind": "^1.
|
|
36
|
+
"eslint-plugin-readable-tailwind": "^1.6.0",
|
|
36
37
|
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
38
|
+
"eslint-plugin-sort-react-dependency-arrays": "^1.0.0",
|
|
37
39
|
"eslint-plugin-tailwindcss": "^3.17.4"
|
|
38
40
|
},
|
|
39
41
|
"devDependencies": {
|
package/react.js
CHANGED
|
@@ -6,12 +6,11 @@ module.exports = {
|
|
|
6
6
|
"plugin:react/jsx-runtime",
|
|
7
7
|
"plugin:jsx-a11y/recommended",
|
|
8
8
|
],
|
|
9
|
-
plugins: ["react-refresh"],
|
|
9
|
+
plugins: ["react-refresh", "sort-react-dependency-arrays"],
|
|
10
10
|
rules: {
|
|
11
11
|
"react/no-array-index-key": "warn",
|
|
12
|
-
"react-refresh/only-export-components": ["warn", {
|
|
13
|
-
|
|
14
|
-
}],
|
|
12
|
+
"react-refresh/only-export-components": ["warn", { allowConstantExport: true }],
|
|
13
|
+
"sort-react-dependency-arrays/sort": "error",
|
|
15
14
|
"unicorn/filename-case": ["error", {
|
|
16
15
|
cases: {
|
|
17
16
|
camelCase: true,
|
package/tailwind.js
CHANGED