@yasainet/eslint 0.0.66 → 0.0.67
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/package.json +2 -1
- package/src/next/index.mjs +2 -0
- package/src/next/tailwindcss.mjs +44 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yasainet/eslint",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.67",
|
|
4
4
|
"description": "ESLint",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@stylistic/eslint-plugin": "^5.9.0",
|
|
37
|
+
"eslint-plugin-better-tailwindcss": "^4.1.1",
|
|
37
38
|
"eslint-plugin-check-file": "^3.3.1",
|
|
38
39
|
"eslint-plugin-jsdoc": "^62.7.1",
|
|
39
40
|
"eslint-plugin-simple-import-sort": "^12.1.1"
|
package/src/next/index.mjs
CHANGED
|
@@ -13,6 +13,7 @@ import { directivesConfigs } from "./directives.mjs";
|
|
|
13
13
|
import { importPathStyleConfigs } from "./imports.mjs";
|
|
14
14
|
import { layoutsConfigs } from "./layouts.mjs";
|
|
15
15
|
import { namingConfigs } from "./naming.mjs";
|
|
16
|
+
import { tailwindcssConfigs } from "./tailwindcss.mjs";
|
|
16
17
|
|
|
17
18
|
const nextEntryPointConfigs = createEntryPointConfigs(
|
|
18
19
|
["src/app/**/*.ts", "src/app/**/*.tsx"],
|
|
@@ -37,5 +38,6 @@ export const eslintConfig = [
|
|
|
37
38
|
...directivesConfigs,
|
|
38
39
|
...importPathStyleConfigs,
|
|
39
40
|
...layoutsConfigs,
|
|
41
|
+
...tailwindcssConfigs,
|
|
40
42
|
...nextEntryPointConfigs,
|
|
41
43
|
];
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import betterTailwindcss from "eslint-plugin-better-tailwindcss";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Tailwind CSS v4 lint rules:
|
|
5
|
+
*
|
|
6
|
+
* - margin is forbidden; spacing is controlled by padding/gap on the parent
|
|
7
|
+
* - class order, deprecated classes, conflicts, duplicates, and whitespace
|
|
8
|
+
* are enforced via `eslint-plugin-better-tailwindcss`
|
|
9
|
+
* - `entryPoint` points at the consuming project's CSS-first Tailwind config
|
|
10
|
+
* (`src/app/globals.css`). Override in the project's eslint.config.mjs if
|
|
11
|
+
* the path differs.
|
|
12
|
+
*/
|
|
13
|
+
export const tailwindcssConfigs = [
|
|
14
|
+
{
|
|
15
|
+
name: "tailwindcss/rules",
|
|
16
|
+
files: ["src/**/*.{ts,tsx}"],
|
|
17
|
+
plugins: { "better-tailwindcss": betterTailwindcss },
|
|
18
|
+
settings: {
|
|
19
|
+
"better-tailwindcss": {
|
|
20
|
+
entryPoint: "src/app/globals.css",
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
rules: {
|
|
24
|
+
"better-tailwindcss/enforce-consistent-class-order": "error",
|
|
25
|
+
"better-tailwindcss/enforce-consistent-important-position": "error",
|
|
26
|
+
"better-tailwindcss/no-conflicting-classes": "error",
|
|
27
|
+
"better-tailwindcss/no-deprecated-classes": "error",
|
|
28
|
+
"better-tailwindcss/no-duplicate-classes": "error",
|
|
29
|
+
"better-tailwindcss/no-restricted-classes": [
|
|
30
|
+
"error",
|
|
31
|
+
{
|
|
32
|
+
restrict: [
|
|
33
|
+
{
|
|
34
|
+
pattern: "^(?!mx-auto$)m[trblxy]?-(?!auto$)[^-\\s]+$",
|
|
35
|
+
message:
|
|
36
|
+
"Avoid margin; control spacing with padding/gap (exceptions: mx-auto, -mt-*)",
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
"better-tailwindcss/no-unnecessary-whitespace": "error",
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
];
|