@fullstacksjs/eslint-config 9.4.0 → 9.5.1

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 CHANGED
@@ -30,7 +30,7 @@ module.exports = init({
30
30
  auto: true, // If you need auto module detection (refer to Auto Module Detection).
31
31
  // Modules configuration check (optional). (refer to Module API)
32
32
  },
33
- // Your configurations
33
+ // Other ESLint configurations
34
34
  });
35
35
 
36
36
  ```
@@ -66,6 +66,8 @@ interface Modules {
66
66
  test?: boolean; // controls jest/vitest plugin
67
67
  cypress?: boolean; // controls cypress plugin
68
68
  storybook?: boolean; // controls storybook plugin
69
+ tailwind?: boolean; // controls tailwindcss plugin
70
+ next?: boolean; // controls next plugin
69
71
  }
70
72
  ```
71
73
 
@@ -88,7 +90,7 @@ React/NextJS configuration should automatically work with Auto Module Detection,
88
90
  ```js
89
91
  module.exports = init({
90
92
  modules: {
91
- react: 'raw' // for React/CRA/Vite
93
+ react: true // for React/CRA/Vite
92
94
  },
93
95
  });
94
96
  ```
@@ -98,7 +100,8 @@ and
98
100
  ```js
99
101
  module.exports = init({
100
102
  modules: {
101
- react: 'next' // for NextJS
103
+ react: true,
104
+ next: true // for NextJS
102
105
  },
103
106
  });
104
107
  ```
@@ -164,6 +167,8 @@ v9 does not have any breaking change, which means the current configuration you
164
167
  * [eslint-plugin-promise](https://github.com/eslint-community/eslint-plugin-promise)
165
168
  * [eslint-plugin-storybook](https://github.com/storybookjs/eslint-plugin-storybook#readme)
166
169
  * [eslint-plugin-graphql](https://github.com/apollographql/eslint-plugin-graphql)
170
+ * [eslint-config-next](https://github.com/vercel/next.js/tree/canary/packages/eslint-config-next)
171
+ * [eslint-plugin-tailwindcss](https://github.com/francoismassart/eslint-plugin-tailwindcss)
167
172
 
168
173
  That's all. Feel free to use 💛
169
174
 
package/base.js CHANGED
@@ -199,7 +199,7 @@ module.exports = {
199
199
  'prefer-named-capture-group': 'off',
200
200
  'prefer-numeric-literals': 'error',
201
201
  'prefer-object-has-own': 'warn',
202
- 'prefer-object-spread': 'warn',
202
+ 'prefer-object-spread': 'off',
203
203
  'prefer-promise-reject-errors': 'off',
204
204
  'prefer-regex-literals': 'off',
205
205
  'prefer-rest-params': 'error',
package/index.js CHANGED
@@ -10,7 +10,9 @@ module.exports = {
10
10
  require.resolve('./promise'),
11
11
  require.resolve('./storybook'),
12
12
  require.resolve('./jest'),
13
+ global.fullstacksjs?.tailwind && require.resolve('./tailwind'),
13
14
  global.fullstacksjs?.react && require.resolve('./react'),
15
+ global.fullstacksjs?.next && require.resolve('./next'),
14
16
  global.fullstacksjs?.typescript && require.resolve('./typescript'),
15
17
  global.fullstacksjs?.cypress && require.resolve('./cypress'),
16
18
  require.resolve('./prettier'),
package/init.d.ts CHANGED
@@ -2,8 +2,10 @@ type Config = import('eslint').Linter.Config;
2
2
  export interface Options extends Config {
3
3
  modules: {
4
4
  auto?: boolean;
5
- react?: 'next' | 'raw';
5
+ react?: boolean;
6
+ next?: boolean;
6
7
  typescript?: { parserProject: string[] | string; resolverProject: string[] | string };
8
+ tailwind?: boolean;
7
9
  node?: boolean;
8
10
  strict?: boolean;
9
11
  import?: boolean;
package/init.js CHANGED
@@ -13,28 +13,33 @@ function init(opts = {}) {
13
13
  opts = global.fullstacksjs;
14
14
 
15
15
  /** @type { import('eslint').Linter.Config } */
16
- const config = {
17
- extends: [
18
- require.resolve('./base'),
19
- require.resolve('./promise'),
20
- require.resolve('./fp'),
21
- opts.node && require.resolve('./node'),
22
- opts.graphql && require.resolve('./graphql'),
23
- opts.import && require.resolve('./import'),
24
- opts.typescript && require.resolve('./typescript'),
25
- opts.react && require.resolve('./react.js'),
26
- opts.storybook && require.resolve('./storybook'),
27
- opts.cypress && require.resolve('./cypress'),
28
- opts.test && require.resolve('./jest'),
29
- opts.esm && require.resolve('./esm'),
30
- opts.strict && require.resolve('./strict'),
31
- require.resolve('./prettier'),
32
- ...extraExtends,
33
- ].filter(Boolean),
34
- parserOptions: {},
35
- settings: {},
36
- ...eslintConfig,
37
- };
16
+ const config = Object.assign(
17
+ {
18
+ extends: [
19
+ require.resolve('./base'),
20
+ require.resolve('./promise'),
21
+ require.resolve('./fp'),
22
+ opts.tailwind && require.resolve('./tailwind'),
23
+ opts.node && require.resolve('./node'),
24
+ opts.graphql && require.resolve('./graphql'),
25
+ opts.import && require.resolve('./import'),
26
+ opts.typescript && require.resolve('./typescript'),
27
+ opts.react && require.resolve('./react.js'),
28
+ opts.next && require.resolve('./next.js'),
29
+ opts.storybook && require.resolve('./storybook'),
30
+ opts.cypress && require.resolve('./cypress'),
31
+ opts.test && require.resolve('./jest'),
32
+ opts.esm && require.resolve('./esm'),
33
+ opts.strict && require.resolve('./strict'),
34
+ require.resolve('./prettier'),
35
+ ]
36
+ .concat(extraExtends)
37
+ .filter(Boolean),
38
+ parserOptions: {},
39
+ settings: {},
40
+ },
41
+ eslintConfig,
42
+ );
38
43
 
39
44
  if (opts.typescript?.parserProject) {
40
45
  config.parserOptions = merge(config.parserOptions, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fullstacksjs/eslint-config",
3
- "version": "9.4.0",
3
+ "version": "9.5.1",
4
4
  "license": "MIT",
5
5
  "author": "fullstacks <fullstacksjs@gmail.com>",
6
6
  "description": "fullstacks eslint config",
@@ -28,6 +28,7 @@
28
28
  "prettier.js",
29
29
  "promise.js",
30
30
  "react.js",
31
+ "tailwind.js",
31
32
  "registerOpts.js",
32
33
  "storybook.js",
33
34
  "strict.js",
@@ -48,9 +49,10 @@
48
49
  "dependencies": {
49
50
  "@fullstacksjs/toolbox": "3.0.2",
50
51
  "@graphql-eslint/eslint-plugin": "3.19.1",
51
- "@typescript-eslint/eslint-plugin": "5.59.7",
52
- "@typescript-eslint/parser": "5.59.7",
52
+ "@typescript-eslint/eslint-plugin": "5.59.8",
53
+ "@typescript-eslint/parser": "5.59.8",
53
54
  "deepmerge": "4.3.1",
55
+ "eslint-config-next": "13.4.4",
54
56
  "eslint-config-prettier": "8.8.0",
55
57
  "eslint-import-resolver-typescript": "3.5.5",
56
58
  "eslint-plugin-cypress": "2.13.3",
@@ -66,23 +68,24 @@
66
68
  "eslint-plugin-react-hooks": "4.6.0",
67
69
  "eslint-plugin-simple-import-sort": "10.0.0",
68
70
  "eslint-plugin-storybook": "0.6.12",
71
+ "eslint-plugin-tailwindcss": "3.12.1",
69
72
  "read-pkg-up": "7.0.1"
70
73
  },
71
74
  "devDependencies": {
72
- "@semantic-release/github": "8.1.0",
75
+ "@semantic-release/github": "9.0.2",
73
76
  "@semantic-release/npm": "10.0.3",
74
77
  "@semantic-release/release-notes-generator": "11.0.2",
75
78
  "cspell": "6.31.1",
76
- "eslint": "8.41.0",
79
+ "eslint": "8.42.0",
77
80
  "eslint-find-rules": "4.1.0",
78
81
  "husky": "8.0.3",
79
82
  "lint-staged": "13.2.2",
80
- "np": "7.7.0",
83
+ "np": "8.0.2",
81
84
  "npm-run-all": "4.1.5",
82
85
  "pinst": "3.0.0",
83
86
  "prettier": "2.8.8",
84
- "semantic-release": "21.0.2",
85
- "typescript": "5.0.4"
87
+ "semantic-release": "21.0.3",
88
+ "typescript": "5.1.3"
86
89
  },
87
90
  "peerDependencies": {
88
91
  "cypress": ">=8",
package/registerOpts.js CHANGED
@@ -6,9 +6,11 @@ const defaultOptions = {
6
6
  cypress: hasDep('cypress'),
7
7
  graphql: hasDep('graphql'),
8
8
  react: hasDep('react'),
9
+ next: hasDep('next'),
9
10
  storybook: hasDep('@storybook/react'),
10
11
  test: hasDep('jest') || hasDep('vitest'),
11
12
  typescript: hasDep('typescript'),
13
+ tailwind: hasDep('tailwindcss'),
12
14
  import: true,
13
15
  node: true,
14
16
  };
package/tailwind.js ADDED
@@ -0,0 +1,15 @@
1
+ /**
2
+ * @type { import('eslint').Linter.Config }
3
+ */
4
+ module.exports = {
5
+ plugins: ['tailwindcss'],
6
+ rules: {
7
+ 'tailwindcss/classnames-order': 'warn',
8
+ 'tailwindcss/enforces-negative-arbitrary-values': 'warn',
9
+ 'tailwindcss/enforces-shorthand': 'warn',
10
+ 'tailwindcss/migration-from-tailwind-2': 'warn',
11
+ 'tailwindcss/no-arbitrary-value': 'off',
12
+ 'tailwindcss/no-custom-classname': 'off',
13
+ 'tailwindcss/no-contradicting-classname': 'error',
14
+ },
15
+ };