@tommy-mitchell/eslint-config-xo 0.5.0 → 0.7.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 CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  module.exports = {
4
4
  plugins: ["perfectionist", "simple-import-sort"],
5
+ settings: {
6
+ perfectionist: {
7
+ partitionByComment: "(group) *",
8
+ type: "natural",
9
+ },
10
+ },
5
11
  rules: {
6
12
  // https://github.com/xojs/eslint-config-xo/blob/v0.44.0/index.js#L304
7
13
  "capitalized-comments": "off",
@@ -10,14 +16,14 @@ module.exports = {
10
16
  // https://github.com/xojs/eslint-config-xo/blob/v0.44.0/index.js#L186
11
17
  "no-warning-comments": ["warn", { decoration: ["/", "*"] }],
12
18
  "object-shorthand": "off",
13
- "perfectionist/sort-array-includes": ["error", { type: "natural" }],
14
- "perfectionist/sort-maps": ["error", { type: "natural" }],
15
- "perfectionist/sort-objects": ["error", { type: "natural" }],
19
+ "perfectionist/sort-array-includes": "error",
20
+ "perfectionist/sort-maps": "error",
21
+ "perfectionist/sort-objects": "error",
16
22
  // 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" }],
23
+ "perfectionist/sort-switch-case": "error",
18
24
  "simple-import-sort/exports": "error",
19
25
  "simple-import-sort/imports": ["error", {
20
- groups: [["^\\u0000", "^node:", "^react", "^react-dom", "^@?\\w", "^", "^\\."]],
26
+ groups: [["^\\u0000", "^node:", "^@?\\w", "^", "^\\."]],
21
27
  }],
22
28
  "unicorn/prefer-regexp-test": "off",
23
29
  "unicorn/prevent-abbreviations": "off",
@@ -32,11 +38,18 @@ module.exports = {
32
38
  "@typescript-eslint/no-confusing-void-expression": ["error", { ignoreArrowShorthand: true }],
33
39
  // https://github.com/xojs/eslint-config-xo-typescript/blob/v2.0.0/index.js#L707
34
40
  "@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" }],
41
+ "perfectionist/sort-enums": ["error", { forceNumericSort: true }],
42
+ "perfectionist/sort-interfaces": "error",
43
+ "perfectionist/sort-intersection-types": "error",
44
+ "perfectionist/sort-object-types": "error",
45
+ "perfectionist/sort-union-types": ["error", { groups: ["unknown", "keyword", "nullish"] }],
46
+ },
47
+ }, {
48
+ files: "test/**/*.*",
49
+ rules: {
50
+ "simple-import-sort/imports": ["error", {
51
+ groups: [["^\\u0000", "^node:", "^ava", "^@?\\w", "^", "^\\."]],
52
+ }],
40
53
  },
41
54
  }],
42
55
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tommy-mitchell/eslint-config-xo",
3
- "version": "0.5.0",
3
+ "version": "0.7.0",
4
4
  "description": "Personal config for XO.",
5
5
  "keywords": [
6
6
  "nodejs",
@@ -29,11 +29,11 @@
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
+ "eslint-plugin-perfectionist": "^3.2.0",
33
33
  "eslint-plugin-react": "^7.35.0",
34
34
  "eslint-plugin-react-hooks": "^4.6.2",
35
35
  "eslint-plugin-react-refresh": "^0.4.9",
36
- "eslint-plugin-readable-tailwind": "^1.6.0",
36
+ "eslint-plugin-readable-tailwind": "^1.7.0",
37
37
  "eslint-plugin-simple-import-sort": "^12.1.1",
38
38
  "eslint-plugin-sort-react-dependency-arrays": "^1.0.0",
39
39
  "eslint-plugin-tailwindcss": "^3.17.4"
package/react.js CHANGED
@@ -10,6 +10,9 @@ module.exports = {
10
10
  rules: {
11
11
  "react/no-array-index-key": "warn",
12
12
  "react-refresh/only-export-components": ["warn", { allowConstantExport: true }],
13
+ "simple-import-sort/imports": ["error", {
14
+ groups: [["^\\u0000", "^node:", "^react", "^react-dom", "^@?\\w", "^", "^\\.", "^.+\\.s?css$"]],
15
+ }],
13
16
  "sort-react-dependency-arrays/sort": "error",
14
17
  "unicorn/filename-case": ["error", {
15
18
  cases: {
@@ -24,5 +27,17 @@ module.exports = {
24
27
  rules: {
25
28
  "@typescript-eslint/naming-convention": "off",
26
29
  },
30
+ }, {
31
+ files: "**/*.{ts,cts,mts,tsx}",
32
+ rules: {
33
+ "perfectionist/sort-interfaces": ["error", {
34
+ customGroups: { callback: "on*" },
35
+ groups: ["unknown", "callback"],
36
+ }],
37
+ "perfectionist/sort-object-types": ["error", {
38
+ customGroups: { callback: "on*" },
39
+ groups: ["unknown", "callback"],
40
+ }],
41
+ },
27
42
  }],
28
43
  };
package/tailwind.js CHANGED
@@ -7,6 +7,7 @@ module.exports = {
7
7
  "readable-tailwind/multiline": ["warn", {
8
8
  group: "newLine",
9
9
  indent: "tab",
10
+ preferSingleLine: true,
10
11
  printWidth: 120,
11
12
  }],
12
13
  "readable-tailwind/no-duplicate-classes": "warn",