@will-stone/eslint-config 0.0.10 → 0.2.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.
- package/CHANGELOG.md +12 -0
- package/eslint-config.js +16 -1
- package/package.json +2 -1
- package/rules/tailwind.js +9 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @will-stone/eslint-config
|
|
2
2
|
|
|
3
|
+
## 0.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 9be0e9d: Added support for ignoring Next.Js build folder.
|
|
8
|
+
|
|
9
|
+
## 0.1.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- de8854e: Added support for Tailwind rules.
|
|
14
|
+
|
|
3
15
|
## 0.0.10
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/eslint-config.js
CHANGED
|
@@ -11,6 +11,7 @@ import reactPlugin from 'eslint-plugin-react'
|
|
|
11
11
|
import reactHooksPlugin from 'eslint-plugin-react-hooks'
|
|
12
12
|
import simpleImportSortPlugin from 'eslint-plugin-simple-import-sort'
|
|
13
13
|
import switchCasePlugin from 'eslint-plugin-switch-case'
|
|
14
|
+
import tailwindPlugin from 'eslint-plugin-tailwindcss'
|
|
14
15
|
import unicornPlugin from 'eslint-plugin-unicorn'
|
|
15
16
|
import globals from 'globals'
|
|
16
17
|
import { globbySync } from 'globby'
|
|
@@ -25,12 +26,14 @@ import nodeRules from './rules/node.js'
|
|
|
25
26
|
import prettierRules from './rules/prettier.js'
|
|
26
27
|
import reactRules from './rules/react.js'
|
|
27
28
|
import switchCaseRules from './rules/switch-case.js'
|
|
29
|
+
import tailwindRules from './rules/tailwind.js'
|
|
28
30
|
import tsRules from './rules/typescript.js'
|
|
29
31
|
import unicornRules from './rules/unicorn.js'
|
|
30
32
|
|
|
31
33
|
let testingFramework = null
|
|
32
34
|
let isNodeEngine = false
|
|
33
35
|
let isPrettier = false
|
|
36
|
+
let isTailwind = false
|
|
34
37
|
|
|
35
38
|
// In a monorepo environment with one eslint instance at the root of the project,
|
|
36
39
|
// we must traverse every child package.json to find out if certain dependencies
|
|
@@ -65,6 +68,16 @@ for (const packageJsonPath of allPackageJsonPaths) {
|
|
|
65
68
|
) {
|
|
66
69
|
isPrettier = true
|
|
67
70
|
}
|
|
71
|
+
|
|
72
|
+
if (
|
|
73
|
+
!isTailwind &&
|
|
74
|
+
Boolean(
|
|
75
|
+
packageJson.dependencies?.tailwindcss ||
|
|
76
|
+
packageJson.devDependencies?.tailwindcss,
|
|
77
|
+
)
|
|
78
|
+
) {
|
|
79
|
+
isTailwind = true
|
|
80
|
+
}
|
|
68
81
|
}
|
|
69
82
|
|
|
70
83
|
const isNode =
|
|
@@ -83,7 +96,7 @@ export default [
|
|
|
83
96
|
// Global ignore patterns
|
|
84
97
|
{
|
|
85
98
|
// Common build folders
|
|
86
|
-
ignores: ['**/.webpack', '**/dist', '**/.astro'],
|
|
99
|
+
ignores: ['**/.webpack', '**/dist', '**/.astro', '**/.next'],
|
|
87
100
|
},
|
|
88
101
|
|
|
89
102
|
// Base
|
|
@@ -140,10 +153,12 @@ export default [
|
|
|
140
153
|
'jsx-a11y': jsxA11yPlugin,
|
|
141
154
|
'react': reactPlugin,
|
|
142
155
|
'react-hooks': reactHooksPlugin,
|
|
156
|
+
...(isTailwind && { tailwindcss: tailwindPlugin }),
|
|
143
157
|
},
|
|
144
158
|
rules: {
|
|
145
159
|
...jsxA11yRules,
|
|
146
160
|
...reactRules,
|
|
161
|
+
...(isTailwind && tailwindRules),
|
|
147
162
|
},
|
|
148
163
|
},
|
|
149
164
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@will-stone/eslint-config",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Will Stone's ESLint config, using the Flat Config style.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ESLint"
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
34
34
|
"eslint-plugin-simple-import-sort": "^10.0.0",
|
|
35
35
|
"eslint-plugin-switch-case": "^1.1.2",
|
|
36
|
+
"eslint-plugin-tailwindcss": "^3.13.0",
|
|
36
37
|
"eslint-plugin-unicorn": "^48.0.1",
|
|
37
38
|
"globals": "^13.21.0",
|
|
38
39
|
"globby": "^13.2.2",
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
'tailwindcss/classnames-order': 'warn',
|
|
3
|
+
'tailwindcss/enforces-negative-arbitrary-values': 'warn',
|
|
4
|
+
'tailwindcss/enforces-shorthand': 'warn',
|
|
5
|
+
'tailwindcss/migration-from-tailwind-2': 'off',
|
|
6
|
+
'tailwindcss/no-arbitrary-value': 'off',
|
|
7
|
+
'tailwindcss/no-contradicting-classname': 'warn',
|
|
8
|
+
'tailwindcss/no-custom-classname': 'error',
|
|
9
|
+
}
|