@switz/eslint-config 12.1.5 → 12.3.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/README.md +15 -5
- package/eslint.config.mjs +0 -10
- package/mdx.mjs +0 -2
- package/package.json +1 -1
- package/react.mjs +4 -6
- package/tailwind.mjs +16 -2
package/README.md
CHANGED
|
@@ -12,7 +12,7 @@ $ pnpm install -D eslint @switz/eslint-config
|
|
|
12
12
|
|
|
13
13
|
Update your eslint config (`eslint.config.mjs`)
|
|
14
14
|
|
|
15
|
-
```
|
|
15
|
+
```js
|
|
16
16
|
import main from '@switz/eslint-config';
|
|
17
17
|
|
|
18
18
|
export default [...main];
|
|
@@ -20,20 +20,30 @@ export default [...main];
|
|
|
20
20
|
|
|
21
21
|
If you need React support, use
|
|
22
22
|
|
|
23
|
-
```
|
|
24
|
-
import react from '@switz/eslint-config/react';
|
|
23
|
+
```js
|
|
24
|
+
import react from '@switz/eslint-config/react.mjs';
|
|
25
25
|
|
|
26
26
|
export default [...react];
|
|
27
27
|
```
|
|
28
28
|
|
|
29
29
|
If you need mdx support, use
|
|
30
30
|
|
|
31
|
-
```
|
|
32
|
-
import mdx from '@switz/eslint-config/mdx';
|
|
31
|
+
```js
|
|
32
|
+
import mdx from '@switz/eslint-config/mdx.mjs';
|
|
33
33
|
|
|
34
34
|
export default [...mdx];
|
|
35
35
|
```
|
|
36
36
|
|
|
37
|
+
If you need tailwind support, use:
|
|
38
|
+
|
|
39
|
+
```js
|
|
40
|
+
import main from '@switz/eslint-config/main.mjs';
|
|
41
|
+
import react from '@switz/eslint-config/react.mjs';
|
|
42
|
+
import tailwind from '@switz/eslint-config/tailwind.mjs';
|
|
43
|
+
|
|
44
|
+
export default [...main, ...react, ...tailwind];
|
|
45
|
+
```
|
|
46
|
+
|
|
37
47
|
You should be able to combine configs just by spreading more into the array.
|
|
38
48
|
|
|
39
49
|
## Reference
|
package/eslint.config.mjs
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import js from '@eslint/js';
|
|
2
2
|
import prettierPlugin from 'eslint-plugin-prettier/recommended';
|
|
3
|
-
import eslintPluginReadableTailwind from 'eslint-plugin-readable-tailwind';
|
|
4
3
|
import globals from 'globals';
|
|
5
4
|
|
|
6
5
|
import tseslint from 'typescript-eslint';
|
|
@@ -36,15 +35,7 @@ export default tseslint.config(
|
|
|
36
35
|
tseslint.configs.recommended,
|
|
37
36
|
{
|
|
38
37
|
files: ['**/*.{js,jsx,ts,tsx}'],
|
|
39
|
-
plugins: {
|
|
40
|
-
'readable-tailwind': eslintPluginReadableTailwind,
|
|
41
|
-
},
|
|
42
38
|
rules: {
|
|
43
|
-
// enable all recommended rules to warn
|
|
44
|
-
...eslintPluginReadableTailwind.configs.warning.rules,
|
|
45
|
-
// enable all recommended rules to error
|
|
46
|
-
...eslintPluginReadableTailwind.configs.error.rules,
|
|
47
|
-
'readable-tailwind/multiline': ['off'],
|
|
48
39
|
'max-len': [
|
|
49
40
|
'error',
|
|
50
41
|
{
|
|
@@ -74,7 +65,6 @@ export default tseslint.config(
|
|
|
74
65
|
'prettier/prettier': [
|
|
75
66
|
'error',
|
|
76
67
|
{
|
|
77
|
-
// plugins: ['prettier-plugin-tailwindcss'],
|
|
78
68
|
singleQuote: true,
|
|
79
69
|
trailingComma: 'es5',
|
|
80
70
|
printWidth: 100,
|
package/mdx.mjs
CHANGED
package/package.json
CHANGED
package/react.mjs
CHANGED
|
@@ -1,19 +1,17 @@
|
|
|
1
|
-
import react from
|
|
2
|
-
import main from "./eslint.config.mjs";
|
|
1
|
+
import react from 'eslint-plugin-react';
|
|
3
2
|
// import tailwind from './tailwind.mjs';
|
|
4
3
|
|
|
5
4
|
export default [
|
|
6
5
|
react.configs.flat.recommended,
|
|
7
|
-
react.configs.flat[
|
|
8
|
-
...main,
|
|
6
|
+
react.configs.flat['jsx-runtime'],
|
|
9
7
|
// ...tailwind,
|
|
10
8
|
{
|
|
11
9
|
rules: {
|
|
12
|
-
|
|
10
|
+
'react/display-name': 'off',
|
|
13
11
|
},
|
|
14
12
|
settings: {
|
|
15
13
|
react: {
|
|
16
|
-
version:
|
|
14
|
+
version: 'detect',
|
|
17
15
|
},
|
|
18
16
|
},
|
|
19
17
|
},
|
package/tailwind.mjs
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
-
import
|
|
1
|
+
import eslintPluginReadableTailwind from 'eslint-plugin-readable-tailwind';
|
|
2
2
|
|
|
3
|
-
export default [
|
|
3
|
+
export default [
|
|
4
|
+
{
|
|
5
|
+
plugins: {
|
|
6
|
+
'readable-tailwind': eslintPluginReadableTailwind,
|
|
7
|
+
},
|
|
8
|
+
rules: {
|
|
9
|
+
// enable all recommended rules to warn
|
|
10
|
+
...eslintPluginReadableTailwind.configs.warning.rules,
|
|
11
|
+
// enable all recommended rules to error
|
|
12
|
+
...eslintPluginReadableTailwind.configs.error.rules,
|
|
13
|
+
// disabled because this conflicts with prettier. not worth the headache
|
|
14
|
+
'readable-tailwind/multiline': ['off'],
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
];
|