@djangocfg/eslint-config 2.1.541 → 2.1.543

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/base.js CHANGED
@@ -2,11 +2,17 @@ import js from "@eslint/js";
2
2
  import eslintConfigPrettier from "eslint-config-prettier";
3
3
  import turboPlugin from "eslint-plugin-turbo";
4
4
  import tseslint from "typescript-eslint";
5
- import onlyWarn from "eslint-plugin-only-warn";
6
5
 
7
6
  /**
8
7
  * A shared ESLint configuration for the repository.
9
8
  *
9
+ * `eslint-plugin-only-warn` used to sit at the bottom of this array, rewriting
10
+ * every rule's severity to "warn". Combined with only 1 of the 25 members that
11
+ * lint passing `--max-warnings 0`, it meant no lint run in this workspace could
12
+ * fail — including `rules-of-hooks`, which `layouts` and `api` deliberately
13
+ * raise to "error" because a hook below an early return is React #310 in
14
+ * production. Removed 2026-09-09; the severities below are now the real ones.
15
+ *
10
16
  * @type {import("eslint").Linter.Config[]}
11
17
  * */
12
18
  export const config = [
@@ -18,7 +24,32 @@ export const config = [
18
24
  turbo: turboPlugin,
19
25
  },
20
26
  rules: {
21
- "turbo/no-undeclared-env-vars": "warn",
27
+ // "error": an env var outside the cache key means turbo can hand back a
28
+ // build made with a different value — a wrong artifact that looks cached
29
+ // and correct. `NEXT_PUBLIC_*` is inlined at build time, so this is not
30
+ // hypothetical.
31
+ "turbo/no-undeclared-env-vars": "error",
32
+ },
33
+ },
34
+ {
35
+ rules: {
36
+ // "error", because this is not style: it found a `startTime` in `nextjs`'s
37
+ // health route that was captured and never reported, dropping the duration
38
+ // the endpoint was meant to return.
39
+ //
40
+ // The ignore patterns encode how this repo already writes "deliberately
41
+ // unused" — an interface method that must keep its signature, a caught
42
+ // error nobody inspects. Without them the convention itself reports as a
43
+ // finding, making the intended spelling the failing one.
44
+ "@typescript-eslint/no-unused-vars": [
45
+ "error",
46
+ {
47
+ argsIgnorePattern: "^_",
48
+ varsIgnorePattern: "^_",
49
+ caughtErrorsIgnorePattern: "^_",
50
+ destructuredArrayIgnorePattern: "^_",
51
+ },
52
+ ],
22
53
  },
23
54
  },
24
55
  {
@@ -36,8 +67,11 @@ export const config = [
36
67
  // with a reason.
37
68
  files: ["**/*.{ts,tsx,js,jsx}"],
38
69
  rules: {
70
+ // "error": a raw color scale does not adapt to theme or preset, and the
71
+ // failure is invisible — the component just renders the wrong color in
72
+ // dark mode. Genuine exceptions disable on the line with a reason.
39
73
  "no-restricted-syntax": [
40
- "warn",
74
+ "error",
41
75
  {
42
76
  selector:
43
77
  "Literal[value=/(bg|text|border|ring|fill|stroke|from|to|via|divide|outline|decoration|accent|caret|shadow)-(red|orange|amber|yellow|lime|green|emerald|teal|cyan|sky|blue|indigo|violet|purple|fuchsia|pink|rose|slate|gray|zinc|neutral|stone)-[0-9]/]",
@@ -53,11 +87,6 @@ export const config = [
53
87
  ],
54
88
  },
55
89
  },
56
- {
57
- plugins: {
58
- onlyWarn,
59
- },
60
- },
61
90
  {
62
91
  ignores: ["dist/**"],
63
92
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@djangocfg/eslint-config",
3
- "version": "2.1.541",
3
+ "version": "2.1.543",
4
4
  "description": "Shared ESLint configurations for Next.js, React, and TypeScript projects with best practices and Prettier integration",
5
5
  "keywords": [
6
6
  "eslint",
@@ -44,7 +44,6 @@
44
44
  "@next/eslint-plugin-next": "^15.5.20",
45
45
  "eslint": "^9.39.5",
46
46
  "eslint-config-prettier": "^10.1.8",
47
- "eslint-plugin-only-warn": "^1.2.1",
48
47
  "eslint-plugin-react": "^7.37.5",
49
48
  "eslint-plugin-react-hooks": "^5.2.0",
50
49
  "eslint-plugin-turbo": "^2.10.4",
package/react-internal.js CHANGED
@@ -34,6 +34,12 @@ export const config = [
34
34
  ...pluginReactHooks.configs.recommended.rules,
35
35
  // React scope no longer necessary with new JSX transform.
36
36
  "react/react-in-jsx-scope": "off",
37
+ // Same reasoning, for TypeScript: `react/prop-types` checks for a runtime
38
+ // `propTypes` declaration, which is what a props TYPE already is here —
39
+ // statically, and more completely. Left on, it reports every typed
40
+ // component in the workspace as unvalidated, which trains readers to
41
+ // scroll past the lint output rather than read it.
42
+ "react/prop-types": "off",
37
43
  },
38
44
  },
39
45
  ];