@slango.configs/eslint 1.2.45 → 1.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 -10
- package/package.json +2 -2
- package/src/presets/typescript-next.js +3 -0
- package/src/presets/typescript-react.js +4 -4
package/README.md
CHANGED
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
This package exposes eslint configurations for easy setup, the following presets are available:
|
|
4
4
|
|
|
5
|
+
> typescript-eslint cannot run on TypeScript 7 (no compiler API until 7.1). Projects on TypeScript 7
|
|
6
|
+
> should use [`@slango.configs/oxlint`](../oxlint/README.md), which mirrors these presets.
|
|
7
|
+
|
|
5
8
|
| Name | Description | Includes |
|
|
6
9
|
| -------------------- | --------------------------------------------------------------------------------------------------- | -------------------------------- |
|
|
7
10
|
| `javascript-node` | Intended to be used for tooling javascript files (eg: eslint.confg.js, linte-staged.config.js, ...) | - |
|
|
@@ -12,16 +15,18 @@ This package exposes eslint configurations for easy setup, the following presets
|
|
|
12
15
|
|
|
13
16
|
## Included plugins/configs
|
|
14
17
|
|
|
15
|
-
| Name | Available in Preset
|
|
16
|
-
| ---------------------------------------------------------------------------------------------------------------- |
|
|
17
|
-
| [`@eslint/js` recommended](https://github.com/eslint/eslint) | `all`
|
|
18
|
-
| [`eslint-plugin-eslint-comments` recommended](https://github.com/eslint-community/eslint-plugin-eslint-comments) | `all`
|
|
19
|
-
| [`eslint-plugin-perfectionist`](https://github.com/azat-io/eslint-plugin-perfectionist) | `all`
|
|
20
|
-
| [`eslint-plugin-regex` recommended](https://github.com/ota-meshi/eslint-plugin-regexp) | `all`
|
|
21
|
-
| [`eslint-plugin-prettier` recommended](https://github.com/prettier/eslint-plugin-prettier) | `all`
|
|
22
|
-
| [`eslint-plugin-import` recommended](https://github.com/import-js/eslint-plugin-import) | `all`
|
|
23
|
-
| [`typescript-eslint` recommendedTypeChecked](https://github.com/typescript-eslint/typescript-eslint) | `all typescript configs`
|
|
24
|
-
| [`
|
|
18
|
+
| Name | Available in Preset | Description |
|
|
19
|
+
| ---------------------------------------------------------------------------------------------------------------- | --------------------------------------------------- | -------------------------------------------------------- |
|
|
20
|
+
| [`@eslint/js` recommended](https://github.com/eslint/eslint) | `all` | @eslint/js official recommended configuration |
|
|
21
|
+
| [`eslint-plugin-eslint-comments` recommended](https://github.com/eslint-community/eslint-plugin-eslint-comments) | `all` | Comments from @eslint-community for comments |
|
|
22
|
+
| [`eslint-plugin-perfectionist`](https://github.com/azat-io/eslint-plugin-perfectionist) | `all` | Configurable sorting rules with tiered strictness levels |
|
|
23
|
+
| [`eslint-plugin-regex` recommended](https://github.com/ota-meshi/eslint-plugin-regexp) | `all` | Recommended config from regexp-eslint-plugin |
|
|
24
|
+
| [`eslint-plugin-prettier` recommended](https://github.com/prettier/eslint-plugin-prettier) | `all` | Prettier official eslint plugin's recommended config |
|
|
25
|
+
| [`eslint-plugin-import` recommended](https://github.com/import-js/eslint-plugin-import) | `all` | Prettier official eslint plugin's recommended config |
|
|
26
|
+
| [`typescript-eslint` recommendedTypeChecked](https://github.com/typescript-eslint/typescript-eslint) | `all typescript configs` | Typescript Eslint type checked recommended config |
|
|
27
|
+
| [`eslint-plugin-react-hooks` recommended](https://react.dev/reference/eslint-plugin-react-hooks) | `typescript-react`, `typescript-next` | rules-of-hooks, exhaustive-deps and React Compiler rules |
|
|
28
|
+
| [`eslint-plugin-react-refresh`](https://github.com/ArnaudBarre/eslint-plugin-react-refresh) | `typescript-react` (vite), `typescript-next` (next) | Fast Refresh boundary checks |
|
|
29
|
+
| [`next/core-web-vitals`](https://nextjs.org/docs/app/building-your-application/configuring/eslint) | `typescript-next` | Next.js official eslint config |
|
|
25
30
|
|
|
26
31
|
## Usage
|
|
27
32
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@slango.configs/eslint",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Slango eslint configs",
|
|
6
6
|
"repository": {
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"eslint-plugin-perfectionist": "5.11.0",
|
|
28
28
|
"eslint-plugin-prettier": "5.5.6",
|
|
29
29
|
"eslint-plugin-react-hooks": "7.1.1",
|
|
30
|
-
"eslint-plugin-react-refresh": "0.5.
|
|
30
|
+
"eslint-plugin-react-refresh": "0.5.6",
|
|
31
31
|
"eslint-plugin-regexp": "3.2.0",
|
|
32
32
|
"globals": "17.12.0",
|
|
33
33
|
"typescript-eslint": "8.69.0"
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import nextPlugin from '@next/eslint-plugin-next';
|
|
2
|
+
import reactRefresh from 'eslint-plugin-react-refresh';
|
|
2
3
|
import tsEslint from 'typescript-eslint';
|
|
3
4
|
|
|
4
5
|
import { globs, normalizeConfig, normalizeOptions, typescriptConfigs } from '../common.js';
|
|
@@ -11,6 +12,8 @@ export const createTypescriptNextConfig = (options = {}) => {
|
|
|
11
12
|
|
|
12
13
|
return [
|
|
13
14
|
...createTypescriptReactConfig(opts),
|
|
15
|
+
// Next.js Fast Refresh allows the framework's special exports (metadata, ...).
|
|
16
|
+
reactRefresh.configs.next,
|
|
14
17
|
...normalizeConfig(
|
|
15
18
|
tsEslint.config(
|
|
16
19
|
...typescriptConfigs(globs.typescript),
|
|
@@ -14,12 +14,12 @@ export const createTypescriptReactConfig = (options = {}) => {
|
|
|
14
14
|
return [
|
|
15
15
|
...createJavascriptNodeConfig(opts),
|
|
16
16
|
jsxA11y.flatConfigs.recommended,
|
|
17
|
+
// Upstream recommended sets: rules-of-hooks, exhaustive-deps and the React
|
|
18
|
+
// Compiler rules; Fast Refresh boundaries as configured for Vite.
|
|
19
|
+
reactHooks.configs.flat.recommended,
|
|
20
|
+
reactRefresh.configs.vite,
|
|
17
21
|
{
|
|
18
22
|
...browserConfig,
|
|
19
|
-
plugins: {
|
|
20
|
-
'react-hooks': reactHooks,
|
|
21
|
-
'react-refresh': reactRefresh,
|
|
22
|
-
},
|
|
23
23
|
name: '@slango.configs/eslint/typescript-react',
|
|
24
24
|
},
|
|
25
25
|
...normalizeConfig(
|