@ethang/eslint-config 19.7.5 → 19.8.1

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 CHANGED
@@ -5,14 +5,15 @@
5
5
  > [!CAUTION]
6
6
  > Do not use this with Prettier! Styling rules are included.
7
7
 
8
- - 889 errored rules.
8
+ - 890 errored rules.
9
9
  - 289 rules from [eslint-plugin-sonarjs](https://github.com/SonarSource/SonarJS/blob/master/packages/jsts/src/rules/README.md)
10
10
  - 144 rules from [@eslint/js](https://github.com/eslint/eslint/tree/main/packages/js)
11
11
  - 113 rules from [sindresorhus/eslint-plugin-unicorn](https://github.com/sindresorhus/eslint-plugin-unicorn)
12
12
  - 103 rules from [@typescript/eslint](https://github.com/typescript-eslint/typescript-eslint)
13
- - 91 rules from [@stylistic/eslint-plugin](https://eslint.style/)
13
+ - 67 rules from [@stylistic/eslint-plugin](https://eslint.style/)
14
14
  - 42 rules from [eslint-plugin-lodash](https://github.com/wix-incubator/eslint-plugin-lodash)
15
15
  - 35 rules from [jsx-a11y](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y)
16
+ - 25 rules from [@stylistic/eslint-plugin-ts](https://eslint.style/)
16
17
  - 20 rules from [eslint-plugin-n](https://github.com/eslint-community/eslint-plugin-n)
17
18
  - 20 rules from [eslint-plugin-perfectionist](https://github.com/azat-io/eslint-plugin-perfectionist)
18
19
  - 7 rules from [eslint-plugin-tailwindcss](https://github.com/francoismassart/eslint-plugin-tailwindcss)
@@ -21,6 +21,7 @@ import { unicornRules } from "../setup/unicorn.ts";
21
21
  import { cspellRules } from "../setup/cspell.js";
22
22
  import { tanstackRouterRules } from "../setup/tanstack-router.js";
23
23
  import { exceptionHandlingRules } from "../setup/exception-handling.js";
24
+ import { stylisticTsRules } from "../setup/stylistic-ts.js";
24
25
 
25
26
  export const ruleList = [
26
27
  {
@@ -144,11 +145,21 @@ export const ruleList = [
144
145
  type: "core",
145
146
  url: "https://eslint.style/",
146
147
  },
148
+ {
149
+ importString: 'import stylisticTs from "@stylistic/eslint-plugin-ts";',
150
+ list: stylisticTsRules,
151
+ name: "@stylistic/eslint-plugin-ts",
152
+ order: 12,
153
+ pluginName: "stylistic-ts",
154
+ pluginValue: "stylisticTs",
155
+ type: "core",
156
+ url: "https://eslint.style/",
157
+ },
147
158
  {
148
159
  importString: 'import perfectionist from "eslint-plugin-perfectionist";',
149
160
  list: perfectionistRules,
150
161
  name: "eslint-plugin-perfectionist",
151
- order: 12,
162
+ order: 13,
152
163
  pluginName: "perfectionist",
153
164
  pluginValue: "perfectionist",
154
165
  type: "core",
@@ -158,7 +169,7 @@ export const ruleList = [
158
169
  importString: 'import tanstackQuery from "@tanstack/eslint-plugin-query";',
159
170
  list: tanstackQueryRules,
160
171
  name: "@tanstack/eslint-plugin-query",
161
- order: 13,
172
+ order: 14,
162
173
  pluginName: "@tanstack/query",
163
174
  pluginValue: "tanstackQuery",
164
175
  type: "core",
@@ -169,7 +180,7 @@ export const ruleList = [
169
180
  'import tanstackRouter from "@tanstack/eslint-plugin-router";',
170
181
  list: tanstackRouterRules,
171
182
  name: "@tanstack/eslint-plugin-router",
172
- order: 14,
183
+ order: 15,
173
184
  pluginName: "@tanstack/router",
174
185
  pluginValue: "tanstackRouter",
175
186
  type: "core",
@@ -179,7 +190,7 @@ export const ruleList = [
179
190
  importString: 'import a11y from "eslint-plugin-jsx-a11y";',
180
191
  list: a11yRules,
181
192
  name: "jsx-a11y",
182
- order: 15,
193
+ order: 16,
183
194
  pluginName: "a11y",
184
195
  pluginValue: "a11y",
185
196
  type: "core",
@@ -189,7 +200,7 @@ export const ruleList = [
189
200
  importString: undefined,
190
201
  list: deprecatedRules,
191
202
  name: "@eslint/js",
192
- order: 16,
203
+ order: 17,
193
204
  pluginName: undefined,
194
205
  pluginValue: undefined,
195
206
  type: "core",
package/eslint.config.js CHANGED
@@ -13,6 +13,7 @@ import n from "eslint-plugin-n";
13
13
  import perfectionist from "eslint-plugin-perfectionist";
14
14
  import sonar from "eslint-plugin-sonarjs";
15
15
  import stylistic from "@stylistic/eslint-plugin";
16
+ import stylisticTs from "@stylistic/eslint-plugin-ts";
16
17
  import tailwind from "eslint-plugin-tailwindcss";
17
18
  import tanstackQuery from "@tanstack/eslint-plugin-query";
18
19
  import tanstackRouter from "@tanstack/eslint-plugin-router";
@@ -40,6 +41,7 @@ export default tseslint.config(
40
41
  "exception-handling": exceptionHandling,
41
42
  tailwind: tailwind,
42
43
  stylistic: stylistic,
44
+ "stylistic-ts": stylisticTs,
43
45
  perfectionist: perfectionist,
44
46
  "@tanstack/query": tanstackQuery,
45
47
  "@tanstack/router": tanstackRouter,
@@ -948,33 +950,21 @@ export default tseslint.config(
948
950
  "stylistic/array-element-newline": ["error", "consistent"],
949
951
  "stylistic/arrow-parens": "error",
950
952
  "stylistic/arrow-spacing": "error",
951
- "stylistic/block-spacing": "error",
952
- "stylistic/brace-style": "error",
953
- "stylistic/comma-dangle": [
954
- "error",
955
- {
956
- arrays: "always-multiline",
957
- objects: "always-multiline",
958
- imports: "always-multiline",
959
- exports: "always-multiline",
960
- functions: "always-multiline",
961
- enums: "never",
962
- generics: "never",
963
- tuples: "never",
964
- },
965
- ],
966
- "stylistic/comma-spacing": "error",
953
+ "stylistic/block-spacing": "off",
954
+ "stylistic/brace-style": "off",
955
+ "stylistic/comma-dangle": "off",
956
+ "stylistic/comma-spacing": "off",
967
957
  "stylistic/comma-style": "error",
968
958
  "stylistic/computed-property-spacing": "error",
969
959
  "stylistic/dot-location": ["error", "property"],
970
960
  "stylistic/eol-last": "error",
971
- "stylistic/func-call-spacing": "error",
961
+ "stylistic/func-call-spacing": "off",
972
962
  "stylistic/function-call-argument-newline": ["error", "consistent"],
973
- "stylistic/function-call-spacing": "error",
963
+ "stylistic/function-call-spacing": "off",
974
964
  "stylistic/function-paren-newline": ["error", "consistent"],
975
965
  "stylistic/generator-star-spacing": "error",
976
966
  "stylistic/implicit-arrow-linebreak": "error",
977
- "stylistic/indent": ["error", 2],
967
+ "stylistic/indent": "off",
978
968
  "stylistic/indent-binary-ops": "error",
979
969
  "stylistic/jsx-child-element-spacing": "error",
980
970
  "stylistic/jsx-closing-bracket-location": "error",
@@ -1000,11 +990,11 @@ export default tseslint.config(
1000
990
  { declaration: "parens-new-line" },
1001
991
  ],
1002
992
  "stylistic/key-spacing": "error",
1003
- "stylistic/keyword-spacing": "error",
993
+ "stylistic/keyword-spacing": "off",
1004
994
  "stylistic/line-comment-position": "off",
1005
995
  "stylistic/linebreak-style": "error",
1006
- "stylistic/lines-around-comment": "error",
1007
- "stylistic/lines-between-class-members": "error",
996
+ "stylistic/lines-around-comment": "off",
997
+ "stylistic/lines-between-class-members": "off",
1008
998
  "stylistic/max-len": [
1009
999
  "error",
1010
1000
  {
@@ -1017,18 +1007,14 @@ export default tseslint.config(
1017
1007
  },
1018
1008
  ],
1019
1009
  "stylistic/max-statements-per-line": "error",
1020
- "stylistic/member-delimiter-style": "error",
1010
+ "stylistic/member-delimiter-style": "off",
1021
1011
  "stylistic/multiline-comment-style": "off",
1022
1012
  "stylistic/multiline-ternary": "error",
1023
1013
  "stylistic/new-parens": "error",
1024
1014
  "stylistic/newline-per-chained-call": "error",
1025
1015
  "stylistic/no-confusing-arrow": "error",
1026
- "stylistic/no-extra-parens": [
1027
- "error",
1028
- "all",
1029
- { ignoreJSX: "multi-line" },
1030
- ],
1031
- "stylistic/no-extra-semi": "error",
1016
+ "stylistic/no-extra-parens": "off",
1017
+ "stylistic/no-extra-semi": "off",
1032
1018
  "stylistic/no-floating-decimal": "error",
1033
1019
  "stylistic/no-mixed-operators": "error",
1034
1020
  "stylistic/no-mixed-spaces-and-tabs": "error",
@@ -1038,40 +1024,81 @@ export default tseslint.config(
1038
1024
  "stylistic/no-trailing-spaces": "error",
1039
1025
  "stylistic/no-whitespace-before-property": "error",
1040
1026
  "stylistic/nonblock-statement-body-position": "error",
1041
- "stylistic/object-curly-newline": [
1042
- "error",
1043
- { multiline: true, consistent: true },
1044
- ],
1045
- "stylistic/object-curly-spacing": ["error", "always"],
1046
- "stylistic/object-property-newline": "error",
1027
+ "stylistic/object-curly-newline": "off",
1028
+ "stylistic/object-curly-spacing": "off",
1029
+ "stylistic/object-property-newline": "off",
1047
1030
  "stylistic/one-var-declaration-per-line": "error",
1048
1031
  "stylistic/operator-linebreak": "error",
1049
1032
  "stylistic/padded-blocks": ["error", "never"],
1050
- "stylistic/padding-line-between-statements": "error",
1051
- "stylistic/quote-props": ["error", "as-needed"],
1052
- "stylistic/quotes": "error",
1033
+ "stylistic/padding-line-between-statements": "off",
1034
+ "stylistic/quote-props": "off",
1035
+ "stylistic/quotes": "off",
1053
1036
  "stylistic/rest-spread-spacing": "error",
1054
- "stylistic/semi": "error",
1037
+ "stylistic/semi": "off",
1055
1038
  "stylistic/semi-spacing": "error",
1056
1039
  "stylistic/semi-style": "error",
1057
- "stylistic/space-before-blocks": "error",
1058
- "stylistic/space-before-function-paren": [
1059
- "error",
1060
- { anonymous: "always", named: "never", asyncArrow: "always" },
1061
- ],
1040
+ "stylistic/space-before-blocks": "off",
1041
+ "stylistic/space-before-function-paren": "off",
1062
1042
  "stylistic/space-in-parens": "error",
1063
- "stylistic/space-infix-ops": "error",
1043
+ "stylistic/space-infix-ops": "off",
1064
1044
  "stylistic/space-unary-ops": "error",
1065
1045
  "stylistic/spaced-comment": "error",
1066
1046
  "stylistic/switch-colon-spacing": "error",
1067
1047
  "stylistic/template-curly-spacing": "error",
1068
1048
  "stylistic/template-tag-spacing": "error",
1069
- "stylistic/type-annotation-spacing": "error",
1049
+ "stylistic/type-annotation-spacing": "off",
1070
1050
  "stylistic/type-generic-spacing": "error",
1071
1051
  "stylistic/type-named-tuple-spacing": "error",
1072
1052
  "stylistic/wrap-iife": "error",
1073
1053
  "stylistic/wrap-regex": "error",
1074
1054
  "stylistic/yield-star-spacing": "error",
1055
+ "stylistic-ts/block-spacing": "error",
1056
+ "stylistic-ts/brace-style": "error",
1057
+ "stylistic-ts/comma-dangle": [
1058
+ "error",
1059
+ {
1060
+ arrays: "always-multiline",
1061
+ objects: "always-multiline",
1062
+ imports: "always-multiline",
1063
+ exports: "always-multiline",
1064
+ functions: "always-multiline",
1065
+ enums: "never",
1066
+ generics: "never",
1067
+ tuples: "never",
1068
+ },
1069
+ ],
1070
+ "stylistic-ts/comma-spacing": "error",
1071
+ "stylistic-ts/func-call-spacing": "error",
1072
+ "stylistic-ts/function-call-spacing": "error",
1073
+ "stylistic-ts/indent": ["error", 2],
1074
+ "stylistic-ts/key-spacing": "error",
1075
+ "stylistic-ts/keyword-spacing": "error",
1076
+ "stylistic-ts/lines-around-comment": "error",
1077
+ "stylistic-ts/lines-between-class-members": "error",
1078
+ "stylistic-ts/member-delimiter-style": "error",
1079
+ "stylistic-ts/no-extra-parens": [
1080
+ "error",
1081
+ "all",
1082
+ { ignoreJSX: "multi-line" },
1083
+ ],
1084
+ "stylistic-ts/no-extra-semi": "error",
1085
+ "stylistic-ts/object-curly-newline": [
1086
+ "error",
1087
+ { multiline: true, consistent: true },
1088
+ ],
1089
+ "stylistic-ts/object-curly-spacing": ["error", "always"],
1090
+ "stylistic-ts/object-property-newline": "error",
1091
+ "stylistic-ts/padding-line-between-statements": "error",
1092
+ "stylistic-ts/quote-props": ["error", "as-needed"],
1093
+ "stylistic-ts/quotes": "error",
1094
+ "stylistic-ts/semi": "error",
1095
+ "stylistic-ts/space-before-blocks": "error",
1096
+ "stylistic-ts/space-before-function-paren": [
1097
+ "error",
1098
+ { anonymous: "always", named: "never", asyncArrow: "always" },
1099
+ ],
1100
+ "stylistic-ts/space-infix-ops": "error",
1101
+ "stylistic-ts/type-annotation-spacing": "error",
1075
1102
  "perfectionist/sort-array-includes": "error",
1076
1103
  "perfectionist/sort-astro-attributes": [
1077
1104
  "error",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ethang/eslint-config",
3
- "version": "19.7.5",
3
+ "version": "19.8.1",
4
4
  "repository": {
5
5
  "url": "git+https://github.com/eglove/eslint-config-ethang.git"
6
6
  },
@@ -20,6 +20,7 @@
20
20
  "@eslint/json": "^0.4.0",
21
21
  "@eslint/markdown": "^6.1.0",
22
22
  "@stylistic/eslint-plugin": "^2.8.0",
23
+ "@stylistic/eslint-plugin-ts": "^2.8.0",
23
24
  "@tanstack/eslint-plugin-query": "^5.57.1",
24
25
  "@tanstack/eslint-plugin-router": "^1.58.6",
25
26
  "@typescript-eslint/parser": "^8.6.0",
@@ -60,6 +61,7 @@
60
61
  "@eslint/json": "^0.4.0",
61
62
  "@eslint/markdown": "^6.1.0",
62
63
  "@stylistic/eslint-plugin": "^2.8.0",
64
+ "@stylistic/eslint-plugin-ts": "^2.8.0",
63
65
  "@tanstack/eslint-plugin-query": "^5.57.1",
64
66
  "@tanstack/eslint-plugin-router": "^1.58.6",
65
67
  "@typescript-eslint/parser": "^8.6.0",
@@ -0,0 +1,51 @@
1
+ import stylisticTs from "@stylistic/eslint-plugin-ts";
2
+ import { genRules, getNonDeprecatedRules } from "./gen-rules.js";
3
+
4
+ const ruleNames = Object.keys(getNonDeprecatedRules(stylisticTs.rules));
5
+
6
+ const customRules = [
7
+ {
8
+ name: "comma-dangle",
9
+ rule: [
10
+ "error",
11
+ {
12
+ arrays: "always-multiline",
13
+ objects: "always-multiline",
14
+ imports: "always-multiline",
15
+ exports: "always-multiline",
16
+ functions: "always-multiline",
17
+ enums: "never",
18
+ generics: "never",
19
+ tuples: "never",
20
+ },
21
+ ],
22
+ },
23
+ { name: "indent", rule: ["error", 2] },
24
+ {
25
+ name: "no-extra-parens",
26
+ rule: ["error", "all", { ignoreJSX: "multi-line" }],
27
+ },
28
+ {
29
+ name: "object-curly-newline",
30
+ rule: ["error", { multiline: true, consistent: true }],
31
+ },
32
+ { name: "object-curly-spacing", rule: ["error", "always"] },
33
+ { name: "quote-props", rule: ["error", "as-needed"] },
34
+ {
35
+ name: "space-before-function-paren",
36
+ rule: [
37
+ "error",
38
+ {
39
+ anonymous: "always",
40
+ named: "never",
41
+ asyncArrow: "always",
42
+ },
43
+ ],
44
+ },
45
+ ];
46
+
47
+ export const stylisticTsRules = genRules(
48
+ ruleNames,
49
+ customRules,
50
+ "stylistic-ts",
51
+ );
@@ -5,28 +5,36 @@ import { genRules, getNonDeprecatedRules } from "./gen-rules.ts";
5
5
  // @ts-expect-error this exists
6
6
  const ruleNames = Object.keys(getNonDeprecatedRules(stylistic.rules));
7
7
  const customRules = [
8
+ { name: "block-spacing", rule: "off" }, // TS
9
+ { name: "brace-style", rule: "off" }, // TS
10
+ { name: "comma-dangle", rule: "off" }, // TS
11
+ { name: "comma-spacing", rule: "off" }, // TS
12
+ { name: "func-call-spacing", rule: "off" }, // TS
13
+ { name: "function-call-spacing", rule: "off" }, // TS
14
+ { name: "indent", rule: "off" }, // TS
15
+ { name: "keyword-spacing", rule: "off" }, // TS
16
+ { name: "lines-around-comment", rule: "off" }, // TS
17
+ { name: "lines-between-class-members", rule: "off" }, // TS
18
+ { name: "member-delimiter-style", rule: "off" }, // TS
19
+ { name: "no-extra-parens", rule: "off" }, // TS
20
+ { name: "no-extra-semi", rule: "off" }, // TS
21
+ { name: "object-curly-newline", rule: "off" }, // TS
22
+ { name: "object-curly-spacing", rule: "off" }, // TS
23
+ { name: "object-property-newline", rule: "off" }, // TS
24
+ { name: "padding-line-between-statements", rule: "off" }, // TS
25
+ { name: "quote-props", rule: "off" }, // TS
26
+ { name: "quotes", rule: "off" }, // TS
27
+ { name: "semi", rule: "off" }, // TS
28
+ { name: "space-before-blocks", rule: "off" }, // TS
29
+ { name: "space-before-function-paren", rule: "off" }, // TS
30
+ { name: "space-infix-ops", rule: "off" }, // TS
31
+ { name: "type-annotation-spacing", rule: "off" }, // TS
32
+
8
33
  { name: "array-bracket-newline", rule: ["error", "consistent"] },
9
34
  { name: "array-element-newline", rule: ["error", "consistent"] },
10
- {
11
- name: "comma-dangle",
12
- rule: [
13
- "error",
14
- {
15
- arrays: "always-multiline",
16
- objects: "always-multiline",
17
- imports: "always-multiline",
18
- exports: "always-multiline",
19
- functions: "always-multiline",
20
- enums: "never",
21
- generics: "never",
22
- tuples: "never",
23
- },
24
- ],
25
- },
26
35
  { name: "dot-location", rule: ["error", "property"] },
27
36
  { name: "function-call-argument-newline", rule: ["error", "consistent"] },
28
37
  { name: "function-paren-newline", rule: ["error", "consistent"] },
29
- { name: "indent", rule: ["error", 2] },
30
38
  { name: "line-comment-position", rule: "off" },
31
39
  {
32
40
  name: "max-len",
@@ -43,28 +51,7 @@ const customRules = [
43
51
  ],
44
52
  },
45
53
  { name: "multiline-comment-style", rule: "off" },
46
- {
47
- name: "no-extra-parens",
48
- rule: ["error", "all", { ignoreJSX: "multi-line" }],
49
- },
50
- {
51
- name: "object-curly-newline",
52
- rule: ["error", { multiline: true, consistent: true }],
53
- },
54
- { name: "object-curly-spacing", rule: ["error", "always"] },
55
54
  { name: "padded-blocks", rule: ["error", "never"] },
56
- { name: "quote-props", rule: ["error", "as-needed"] },
57
- {
58
- name: "space-before-function-paren",
59
- rule: [
60
- "error",
61
- {
62
- anonymous: "always",
63
- named: "never",
64
- asyncArrow: "always",
65
- },
66
- ],
67
- },
68
55
  { name: "jsx-indent-props", rule: ["error", 2] },
69
56
  { name: "jsx-newline", rule: ["error", { prevent: true }] },
70
57
  { name: "jsx-sort-props", rule: "off" },