@djangocfg/eslint-config 2.1.542 → 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 +24 -14
- package/package.json +1 -2
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,19 +24,25 @@ export const config = [
|
|
|
18
24
|
turbo: turboPlugin,
|
|
19
25
|
},
|
|
20
26
|
rules: {
|
|
21
|
-
"
|
|
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",
|
|
22
32
|
},
|
|
23
33
|
},
|
|
24
34
|
{
|
|
25
35
|
rules: {
|
|
26
|
-
//
|
|
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
|
|
27
41
|
// unused" — an interface method that must keep its signature, a caught
|
|
28
|
-
// error nobody inspects.
|
|
29
|
-
//
|
|
30
|
-
// a package linting with `--max-warnings 0` that made the intended
|
|
31
|
-
// spelling the failing one.
|
|
42
|
+
// error nobody inspects. Without them the convention itself reports as a
|
|
43
|
+
// finding, making the intended spelling the failing one.
|
|
32
44
|
"@typescript-eslint/no-unused-vars": [
|
|
33
|
-
"
|
|
45
|
+
"error",
|
|
34
46
|
{
|
|
35
47
|
argsIgnorePattern: "^_",
|
|
36
48
|
varsIgnorePattern: "^_",
|
|
@@ -55,8 +67,11 @@ export const config = [
|
|
|
55
67
|
// with a reason.
|
|
56
68
|
files: ["**/*.{ts,tsx,js,jsx}"],
|
|
57
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.
|
|
58
73
|
"no-restricted-syntax": [
|
|
59
|
-
"
|
|
74
|
+
"error",
|
|
60
75
|
{
|
|
61
76
|
selector:
|
|
62
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]/]",
|
|
@@ -72,11 +87,6 @@ export const config = [
|
|
|
72
87
|
],
|
|
73
88
|
},
|
|
74
89
|
},
|
|
75
|
-
{
|
|
76
|
-
plugins: {
|
|
77
|
-
onlyWarn,
|
|
78
|
-
},
|
|
79
|
-
},
|
|
80
90
|
{
|
|
81
91
|
ignores: ["dist/**"],
|
|
82
92
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@djangocfg/eslint-config",
|
|
3
|
-
"version": "2.1.
|
|
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",
|