@will-stone/eslint-config 25.2.1 → 26.0.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.
Files changed (2) hide show
  1. package/dist/index.js +62 -62
  2. package/package.json +3 -2
package/dist/index.js CHANGED
@@ -19,7 +19,7 @@ const i = "?([cm])[jt]s?(x)", d = `**/*.${i}`, j = "**/*.?([cm])ts", x = "**/*.?
19
19
  `**/*.test.${i}`,
20
20
  `**/*.bench.${i}`,
21
21
  `**/*.benchmark.${i}`
22
- ], T = "**/*.astro", A = "**/*.astro/*.ts", I = "**/*.{jsx,tsx,astro}", B = [
22
+ ], T = "**/*.astro", A = "**/*.astro/*.ts", B = "**/*.{jsx,tsx,astro}", I = [
23
23
  "**/node_modules",
24
24
  "**/dist",
25
25
  "**/package-lock.json",
@@ -390,7 +390,7 @@ function K() {
390
390
  function $() {
391
391
  return [
392
392
  {
393
- ignores: B,
393
+ ignores: I,
394
394
  name: "will-stone/ignores"
395
395
  },
396
396
  {
@@ -698,6 +698,7 @@ async function z(r) {
698
698
  },
699
699
  name: "will-stone/react",
700
700
  plugins: {
701
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
701
702
  "jsx-a11y": e,
702
703
  react: o,
703
704
  "react-hooks": t
@@ -1065,13 +1066,10 @@ function M() {
1065
1066
  async function V({
1066
1067
  options: { tailwind: r }
1067
1068
  }) {
1068
- const e = !r || r === !0 ? {} : r, o = await s(
1069
- // @ts-expect-error -- no types
1070
- import("eslint-plugin-tailwindcss")
1071
- );
1069
+ const e = r === !1 || r === !0 ? {} : r, o = await s(import("eslint-plugin-tailwindcss"));
1072
1070
  return [
1073
1071
  {
1074
- files: [I],
1072
+ files: [B],
1075
1073
  name: "will-stone/tailwind",
1076
1074
  plugins: { tailwindcss: o },
1077
1075
  rules: {
@@ -1086,7 +1084,7 @@ async function V({
1086
1084
  },
1087
1085
  settings: {
1088
1086
  tailwindcss: {
1089
- config: e.config,
1087
+ config: e?.config,
1090
1088
  /**
1091
1089
  * Default to no custom CSS files, due to performance issue with the
1092
1090
  * plugin can be somewhat mitigated by setting this config to `[]` so
@@ -1094,7 +1092,7 @@ async function V({
1094
1092
  * @see https://github.com/francoismassart/eslint-plugin-tailwindcss/issues/276
1095
1093
  * @see https://github.com/francoismassart/eslint-plugin-tailwindcss/issues/174
1096
1094
  */
1097
- cssFiles: e.cssFiles || []
1095
+ cssFiles: e?.cssFiles || []
1098
1096
  }
1099
1097
  }
1100
1098
  }
@@ -1212,67 +1210,69 @@ function X() {
1212
1210
  /**
1213
1211
  * These require type checking.
1214
1212
  */
1215
- "@typescript-eslint/await-thenable": "off",
1213
+ "@typescript-eslint/await-thenable": "error",
1216
1214
  "@typescript-eslint/consistent-return": "off",
1217
1215
  "@typescript-eslint/consistent-type-exports": "warn",
1218
- "@typescript-eslint/dot-notation": "off",
1216
+ "@typescript-eslint/dot-notation": "warn",
1219
1217
  "@typescript-eslint/naming-convention": "off",
1220
- "@typescript-eslint/no-array-delete": "off",
1221
- "@typescript-eslint/no-base-to-string": "off",
1222
- "@typescript-eslint/no-confusing-void-expression": "off",
1218
+ "@typescript-eslint/no-array-delete": "error",
1219
+ "@typescript-eslint/no-base-to-string": "error",
1220
+ "@typescript-eslint/no-confusing-void-expression": "warn",
1223
1221
  "@typescript-eslint/no-deprecated": "off",
1224
- "@typescript-eslint/no-duplicate-type-constituents": "off",
1225
- "@typescript-eslint/no-floating-promises": "off",
1226
- "@typescript-eslint/no-for-in-array": "off",
1227
- "@typescript-eslint/no-implied-eval": "off",
1222
+ "@typescript-eslint/no-duplicate-type-constituents": "warn",
1223
+ "@typescript-eslint/no-floating-promises": "error",
1224
+ "@typescript-eslint/no-for-in-array": "error",
1225
+ "@typescript-eslint/no-implied-eval": "error",
1228
1226
  "@typescript-eslint/no-meaningless-void-operator": "warn",
1229
1227
  "@typescript-eslint/no-misused-promises": "off",
1230
- "@typescript-eslint/no-misused-spread": "off",
1231
- "@typescript-eslint/no-mixed-enums": "off",
1232
- "@typescript-eslint/no-redundant-type-constituents": "off",
1233
- "@typescript-eslint/no-unnecessary-boolean-literal-compare": "off",
1234
- "@typescript-eslint/no-unnecessary-condition": "off",
1235
- "@typescript-eslint/no-unnecessary-qualifier": "off",
1228
+ "@typescript-eslint/no-misused-spread": "error",
1229
+ "@typescript-eslint/no-mixed-enums": "error",
1230
+ "@typescript-eslint/no-redundant-type-constituents": "error",
1231
+ "@typescript-eslint/no-unnecessary-boolean-literal-compare": "warn",
1232
+ "@typescript-eslint/no-unnecessary-condition": "error",
1233
+ "@typescript-eslint/no-unnecessary-qualifier": "warn",
1236
1234
  "@typescript-eslint/no-unnecessary-template-expression": "error",
1237
- "@typescript-eslint/no-unnecessary-type-arguments": "off",
1238
- "@typescript-eslint/no-unnecessary-type-assertion": "off",
1239
- "@typescript-eslint/no-unnecessary-type-conversion": "off",
1235
+ "@typescript-eslint/no-unnecessary-type-arguments": "warn",
1236
+ "@typescript-eslint/no-unnecessary-type-assertion": "warn",
1237
+ "@typescript-eslint/no-unnecessary-type-conversion": "error",
1240
1238
  "@typescript-eslint/no-unnecessary-type-parameters": "error",
1241
- "@typescript-eslint/no-unsafe-argument": "off",
1242
- "@typescript-eslint/no-unsafe-assignment": "off",
1243
- "@typescript-eslint/no-unsafe-call": "off",
1244
- "@typescript-eslint/no-unsafe-enum-comparison": "off",
1245
- "@typescript-eslint/no-unsafe-member-access": "off",
1246
- "@typescript-eslint/no-unsafe-return": "off",
1239
+ "@typescript-eslint/no-unsafe-argument": "error",
1240
+ "@typescript-eslint/no-unsafe-assignment": "error",
1241
+ "@typescript-eslint/no-unsafe-call": "error",
1242
+ "@typescript-eslint/no-unsafe-enum-comparison": "error",
1243
+ "@typescript-eslint/no-unsafe-member-access": "error",
1244
+ "@typescript-eslint/no-unsafe-return": "error",
1245
+ // All assertions are unsafe and this makes it more difficult to cast.
1247
1246
  "@typescript-eslint/no-unsafe-type-assertion": "off",
1248
- "@typescript-eslint/no-unsafe-unary-minus": "off",
1249
- "@typescript-eslint/no-useless-default-assignment": "off",
1250
- "@typescript-eslint/non-nullable-type-assertion-style": "off",
1251
- "@typescript-eslint/only-throw-error": "off",
1252
- "@typescript-eslint/prefer-destructuring": "off",
1253
- "@typescript-eslint/prefer-find": "off",
1254
- "@typescript-eslint/prefer-includes": "off",
1247
+ "@typescript-eslint/no-unsafe-unary-minus": "error",
1248
+ "@typescript-eslint/no-useless-default-assignment": "warn",
1249
+ "@typescript-eslint/non-nullable-type-assertion-style": "warn",
1250
+ "@typescript-eslint/only-throw-error": "error",
1251
+ "@typescript-eslint/prefer-destructuring": ["warn", { array: !1, object: !0 }],
1252
+ "@typescript-eslint/prefer-find": "error",
1253
+ "@typescript-eslint/prefer-includes": "warn",
1255
1254
  "@typescript-eslint/prefer-nullish-coalescing": "off",
1256
- "@typescript-eslint/prefer-optional-chain": "off",
1257
- "@typescript-eslint/prefer-promise-reject-errors": "off",
1258
- "@typescript-eslint/prefer-readonly": "off",
1255
+ "@typescript-eslint/prefer-optional-chain": "warn",
1256
+ "@typescript-eslint/prefer-promise-reject-errors": "error",
1257
+ "@typescript-eslint/prefer-readonly": "warn",
1258
+ // Typing all args as readonly is tiresome.
1259
1259
  "@typescript-eslint/prefer-readonly-parameter-types": "off",
1260
- "@typescript-eslint/prefer-reduce-type-parameter": "off",
1260
+ "@typescript-eslint/prefer-reduce-type-parameter": "warn",
1261
1261
  "@typescript-eslint/prefer-regexp-exec": "off",
1262
- "@typescript-eslint/prefer-return-this-type": "off",
1263
- "@typescript-eslint/prefer-string-starts-ends-with": "off",
1264
- "@typescript-eslint/promise-function-async": "off",
1265
- "@typescript-eslint/related-getter-setter-pairs": "off",
1266
- "@typescript-eslint/require-array-sort-compare": "off",
1267
- "@typescript-eslint/require-await": "off",
1268
- "@typescript-eslint/restrict-plus-operands": "off",
1269
- "@typescript-eslint/restrict-template-expressions": "off",
1270
- "@typescript-eslint/return-await": "off",
1271
- "@typescript-eslint/strict-boolean-expressions": "off",
1272
- "@typescript-eslint/strict-void-return": "off",
1273
- "@typescript-eslint/switch-exhaustiveness-check": "off",
1274
- "@typescript-eslint/unbound-method": "off",
1275
- "@typescript-eslint/use-unknown-in-catch-callback-variable": "off"
1262
+ "@typescript-eslint/prefer-return-this-type": "warn",
1263
+ "@typescript-eslint/prefer-string-starts-ends-with": "warn",
1264
+ "@typescript-eslint/promise-function-async": "warn",
1265
+ "@typescript-eslint/related-getter-setter-pairs": "error",
1266
+ "@typescript-eslint/require-array-sort-compare": "error",
1267
+ "@typescript-eslint/require-await": "error",
1268
+ "@typescript-eslint/restrict-plus-operands": "error",
1269
+ "@typescript-eslint/restrict-template-expressions": "error",
1270
+ "@typescript-eslint/return-await": "warn",
1271
+ "@typescript-eslint/strict-boolean-expressions": "error",
1272
+ "@typescript-eslint/strict-void-return": "error",
1273
+ "@typescript-eslint/switch-exhaustiveness-check": "error",
1274
+ "@typescript-eslint/unbound-method": "error",
1275
+ "@typescript-eslint/use-unknown-in-catch-callback-variable": "error"
1276
1276
  }
1277
1277
  }
1278
1278
  ];
@@ -1597,7 +1597,7 @@ function Y(r) {
1597
1597
  for (const a of e) {
1598
1598
  const p = L(a), l = new TextDecoder().decode(p), f = JSON.parse(l);
1599
1599
  for (const n of r)
1600
- if (f && (f.dependencies?.[n] || f.devDependencies?.[n]) && (o[n] = !0, t()))
1600
+ if ((typeof f.dependencies?.[n] == "string" || typeof f.devDependencies?.[n] == "string") && (o[n] = !0, t()))
1601
1601
  break;
1602
1602
  if (t())
1603
1603
  break;
@@ -1608,15 +1608,15 @@ const Z = E("eslint:ws"), ee = {};
1608
1608
  async function re(r = ee) {
1609
1609
  const e = [], o = Object.values(m).map(({ dep: n }) => n), t = Y(o), a = m.filter(({ dep: n, optionName: u }) => (
1610
1610
  // Is forced on.
1611
- r?.[u] || // Is present and not forced off.
1612
- t[n] && r?.[u] !== !1
1611
+ !!r[u] || // Is present and not forced off.
1612
+ t[n] && r[u] !== !1
1613
1613
  )), p = {
1614
1614
  options: r
1615
1615
  };
1616
1616
  for (const n of Q)
1617
1617
  e.push(n.config(p));
1618
1618
  const l = await Promise.all(
1619
- a.map((n) => (Z(`Auto-configured ${n.name} plugin`), n.config(p)))
1619
+ a.map(async (n) => (Z(`Auto-configured ${n.name} plugin`), n.config(p)))
1620
1620
  );
1621
1621
  return e.push(...l), e.flat();
1622
1622
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@will-stone/eslint-config",
3
- "version": "25.2.1",
3
+ "version": "26.0.0",
4
4
  "description": "Will Stone's ESLint config",
5
5
  "keywords": [
6
6
  "eslint-config"
@@ -55,6 +55,7 @@
55
55
  "@commits-with-character/conventional-changelog-preset": "^5.1.1",
56
56
  "@eslint/config-inspector": "^1.4.2",
57
57
  "@release-it/conventional-changelog": "^10.0.5",
58
+ "@types/eslint-plugin-tailwindcss": "^3.17.0",
58
59
  "@types/node": "^24.10.13",
59
60
  "@typescript-eslint/utils": "^8.55.0",
60
61
  "@vitest/eslint-plugin": "^1.6.7",
@@ -106,7 +107,7 @@
106
107
  "optional": true
107
108
  }
108
109
  },
109
- "packageManager": "pnpm@10.29.3",
110
+ "packageManager": "pnpm@10.30.3",
110
111
  "engines": {
111
112
  "node": ">=22"
112
113
  },