@panates/eslint-config-react 2.3.0 → 2.3.2

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
@@ -33,16 +33,19 @@ export default [...panatesReact.configs.react];
33
33
  // eslint.config.mjs - Next.js
34
34
  import next from '@panates/eslint-config-react/next';
35
35
 
36
- export default [{ ignores: ['.next/**'] }, ...next];
36
+ export default [...next];
37
37
  ```
38
38
 
39
39
  ```js
40
40
  // eslint.config.mjs - Vite
41
41
  import vite from '@panates/eslint-config-react/vite';
42
42
 
43
- export default [{ ignores: ['dist/**'] }, ...vite];
43
+ export default [...vite];
44
44
  ```
45
45
 
46
+ The Vite entry leaves `dist` and `coverage` unlinted, the Next one `.next`. A build directory of
47
+ your own goes in an `ignores` block of your own.
48
+
46
49
  `configPatches.react` is the React layer alone, to add on top of a config of your own.
47
50
 
48
51
  ## Notes
@@ -52,3 +55,17 @@ export default [{ ignores: ['dist/**'] }, ...vite];
52
55
  - **Hooks are checked once.** Rules both plugins have (`rules-of-hooks`, `exhaustive-deps`, the
53
56
  React Compiler ones) are left to `react-hooks`.
54
57
  - **Relative imports need no extension** (`import-x/extensions` is off) - a bundler resolves them.
58
+ - **A prettier plugin named in a package's prettier config is resolved from where ESLint runs.**
59
+ Formatting is checked through `eslint-plugin-prettier`, and prettier looks a plugin name such as
60
+ `'prettier-plugin-tailwindcss'` up from the working directory - so `eslint` run at a monorepo's
61
+ root fails with `Cannot find package ...` for a plugin only that package installs. Resolve it
62
+ against the config file instead:
63
+
64
+ ```js
65
+ // prettier.config.js
66
+ import { fileURLToPath } from 'node:url';
67
+
68
+ export default {
69
+ plugins: [fileURLToPath(import.meta.resolve('prettier-plugin-tailwindcss'))],
70
+ };
71
+ ```
package/configs/next.js CHANGED
@@ -5,10 +5,16 @@ import reactConfig from './react.js';
5
5
  * A Next.js application: the React config plus Next's own rules, at the stricter
6
6
  * `core-web-vitals` level `create-next-app` sets up (it includes `recommended`).
7
7
  *
8
+ * Next's build output, `.next`, is not linted.
9
+ *
8
10
  * Its own entry point (`@panates/eslint-config-react/next`), so a project that is not on Next does
9
11
  * not need `@next/eslint-plugin-next` installed.
10
12
  */
11
13
  export default [
14
+ {
15
+ name: 'panates/next/ignores',
16
+ ignores: ['**/.next/**'],
17
+ },
12
18
  ...reactConfig,
13
19
  {
14
20
  ...nextPlugin.configs['core-web-vitals'],
package/configs/vite.js CHANGED
@@ -5,10 +5,16 @@ import reactConfig from './react.js';
5
5
  * A React application built with Vite: the React config plus `react-refresh/only-export-components`,
6
6
  * which flags a module whose exports would make Vite's hot reload fall back to a full page reload.
7
7
  *
8
+ * What a build or a test run writes - `dist`, `coverage` - is not linted.
9
+ *
8
10
  * Its own entry point (`@panates/eslint-config-react/vite`), so a project that is not on Vite does
9
11
  * not need `eslint-plugin-react-refresh` installed.
10
12
  */
11
13
  export default [
14
+ {
15
+ name: 'panates/vite/ignores',
16
+ ignores: ['**/dist/**', '**/coverage/**'],
17
+ },
12
18
  ...reactConfig,
13
19
  {
14
20
  ...reactRefreshPlugin.configs.vite,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@panates/eslint-config-react",
3
- "version": "2.3.0",
3
+ "version": "2.3.2",
4
4
  "description": "React rules for Panates ESLint config, following our styleguide",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -11,7 +11,7 @@
11
11
  "./package.json": "./package.json"
12
12
  },
13
13
  "dependencies": {
14
- "@panates/eslint-config-ts": "^2.3.0"
14
+ "@panates/eslint-config-ts": "^2.3.2"
15
15
  },
16
16
  "peerDependencies": {
17
17
  "@eslint-react/eslint-plugin": ">=5",
@@ -37,10 +37,10 @@
37
37
  },
38
38
  "author": "Panates",
39
39
  "license": "MIT",
40
- "homepage": "https://github.com/panates/javascript.git",
40
+ "homepage": "https://github.com/panates/javascript/tree/main/packages/eslint-config-react#readme",
41
41
  "repository": {
42
42
  "type": "git",
43
- "url": "https://github.com/panates/javascript.git",
43
+ "url": "git+https://github.com/panates/javascript.git",
44
44
  "directory": "./packages/eslint-config-react"
45
45
  },
46
46
  "bugs": {