@4mbl/lint 0.0.0-beta.afda011 → 0.0.0-beta.d17fc69
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 +26 -0
- package/README.md +20 -4
- package/package.json +12 -7
- package/src/next.ts +6 -2
- package/src/react.ts +32 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
# @4mbl/lint
|
|
2
2
|
|
|
3
|
+
## 0.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 6d969e6: Add react template
|
|
8
|
+
- 6d969e6: Upgrade eslint and config dependencies
|
|
9
|
+
|
|
10
|
+
## 0.2.1
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- 3a223fe: Use flat config version of eslint-plugin-react-hooks
|
|
15
|
+
|
|
16
|
+
## 0.2.0
|
|
17
|
+
|
|
18
|
+
### Minor Changes
|
|
19
|
+
|
|
20
|
+
- c4e49f3: Add eslint-plugin-react-hooks
|
|
21
|
+
- c4e49f3: Add eslint-config-prettier
|
|
22
|
+
|
|
23
|
+
## 0.1.1
|
|
24
|
+
|
|
25
|
+
### Patch Changes
|
|
26
|
+
|
|
27
|
+
- 2c91355: Move dependencies not to be dev-only
|
|
28
|
+
|
|
3
29
|
## 0.1.0
|
|
4
30
|
|
|
5
31
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
## Usage
|
|
12
12
|
|
|
13
|
-
Install the [`@4mbl/lint`](https://www.npmjs.com/package/@4mbl/lint)
|
|
13
|
+
Install the [`@4mbl/lint`](https://www.npmjs.com/package/@4mbl/lint) package.
|
|
14
14
|
|
|
15
15
|
```shell
|
|
16
16
|
npm install -D @4mbl/lint
|
|
@@ -24,18 +24,34 @@ import defaultConfig, { type Config } from '@4mbl/lint/next'; // <-- change `nex
|
|
|
24
24
|
export default [...defaultConfig] satisfies Config[];
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
+
Set a script that uses the linting package.
|
|
28
|
+
|
|
29
|
+
```shell
|
|
30
|
+
npm pkg set scripts.lint="eslint src"
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
You may need to explicitly allow the underlying linting packages to be used by your scripts.
|
|
34
|
+
|
|
35
|
+
For example, when using pnpm, you need to set `publicHoistPattern` in your `pnpm-workspace.yaml` for ESLint.
|
|
36
|
+
|
|
37
|
+
```yaml
|
|
38
|
+
publicHoistPattern:
|
|
39
|
+
- eslint
|
|
40
|
+
```
|
|
41
|
+
|
|
27
42
|
## Available templates
|
|
28
43
|
|
|
29
44
|
There is currently one config template.
|
|
30
45
|
|
|
31
46
|
- **Next** - Linting configuration extending the Next.js default config.
|
|
47
|
+
- **React** - Linting configuration extending the Vite-React default config.
|
|
32
48
|
|
|
33
49
|
## Versioning
|
|
34
50
|
|
|
35
|
-
|
|
51
|
+
_Until v1.0.0 is released, breaking changes may be introduced in minor releases without prior warnings._
|
|
36
52
|
|
|
37
|
-
The package follows the following versioning scheme: `X.Y.Z
|
|
53
|
+
The package follows the following versioning scheme: `X.Y.Z`.
|
|
38
54
|
|
|
39
|
-
- `X` - Reserved for linting provider changes as those might cause wider backwards
|
|
55
|
+
- `X` - Reserved for linting provider changes as those might cause wider backwards compatibility issues.
|
|
40
56
|
- `Y` - New linting rules. New rules are first added as warnings, and if error is preferred, the rule is promoted to produce errors in the next minor release.
|
|
41
57
|
- `Z` - Minor fixes that make the previous release unusable.
|
package/package.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@4mbl/lint",
|
|
3
|
-
"version": "0.0.0-beta.
|
|
3
|
+
"version": "0.0.0-beta.d17fc69",
|
|
4
4
|
"description": "Linting configuration for various environments.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "4mbl",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"homepage": "https://github.com/4mbl/config/tree/main/packages/lint#readme",
|
|
9
9
|
"exports": {
|
|
10
|
-
"./next": "./src/next.ts"
|
|
10
|
+
"./next": "./src/next.ts",
|
|
11
|
+
"./react": "./src/react.ts"
|
|
11
12
|
},
|
|
12
13
|
"files": [
|
|
13
14
|
"src",
|
|
@@ -23,13 +24,17 @@
|
|
|
23
24
|
"keywords": [
|
|
24
25
|
"lint"
|
|
25
26
|
],
|
|
26
|
-
"
|
|
27
|
-
"@eslint/js": "^9.
|
|
28
|
-
"eslint": "^9.
|
|
29
|
-
"eslint-config-next": "^16.0.
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"@eslint/js": "^9.39.1",
|
|
29
|
+
"eslint": "^9.39.1",
|
|
30
|
+
"eslint-config-next": "^16.0.3",
|
|
31
|
+
"eslint-config-prettier": "^10.1.8",
|
|
30
32
|
"eslint-plugin-react-compiler": "19.1.0-rc.2",
|
|
33
|
+
"eslint-plugin-react-hooks": "^7.0.1",
|
|
34
|
+
"eslint-plugin-react-refresh": "^0.4.24",
|
|
35
|
+
"globals": "^16.5.0",
|
|
31
36
|
"jiti": "^2.6.1",
|
|
32
|
-
"typescript-eslint": "^8.
|
|
37
|
+
"typescript-eslint": "^8.47.0"
|
|
33
38
|
},
|
|
34
39
|
"scripts": {}
|
|
35
40
|
}
|
package/src/next.ts
CHANGED
|
@@ -2,8 +2,10 @@
|
|
|
2
2
|
import js from '@eslint/js';
|
|
3
3
|
import nextVitals from 'eslint-config-next/core-web-vitals';
|
|
4
4
|
import nextTs from 'eslint-config-next/typescript';
|
|
5
|
+
import prettier from 'eslint-config-prettier/flat';
|
|
5
6
|
import * as reactCompiler from 'eslint-plugin-react-compiler';
|
|
6
|
-
import
|
|
7
|
+
import reactHooks from 'eslint-plugin-react-hooks';
|
|
8
|
+
import { Config, defineConfig, globalIgnores } from 'eslint/config';
|
|
7
9
|
import tseslint from 'typescript-eslint';
|
|
8
10
|
|
|
9
11
|
export { Config };
|
|
@@ -20,11 +22,13 @@ export default defineConfig([
|
|
|
20
22
|
},
|
|
21
23
|
...nextVitals,
|
|
22
24
|
...nextTs,
|
|
23
|
-
|
|
25
|
+
reactHooks.configs.flat.recommended,
|
|
24
26
|
reactCompiler.configs.recommended,
|
|
25
27
|
{
|
|
26
28
|
rules: {
|
|
27
29
|
'react-compiler/react-compiler': 'error',
|
|
28
30
|
},
|
|
29
31
|
},
|
|
32
|
+
prettier,
|
|
33
|
+
globalIgnores(['.next/**', 'out/**', 'build/**', 'next-env.d.ts']),
|
|
30
34
|
]) satisfies Config[];
|
package/src/react.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import js from '@eslint/js';
|
|
2
|
+
import prettier from 'eslint-config-prettier/flat';
|
|
3
|
+
import reactHooks from 'eslint-plugin-react-hooks';
|
|
4
|
+
import reactRefresh from 'eslint-plugin-react-refresh';
|
|
5
|
+
import { defineConfig, globalIgnores } from 'eslint/config';
|
|
6
|
+
import globals from 'globals';
|
|
7
|
+
import tseslint from 'typescript-eslint';
|
|
8
|
+
|
|
9
|
+
export default defineConfig([
|
|
10
|
+
js.configs.recommended,
|
|
11
|
+
tseslint.configs.recommended,
|
|
12
|
+
|
|
13
|
+
reactHooks.configs.flat.recommended,
|
|
14
|
+
reactRefresh.configs.recommended,
|
|
15
|
+
|
|
16
|
+
globalIgnores(['dist']),
|
|
17
|
+
{
|
|
18
|
+
files: ['**/*.{ts,tsx}'],
|
|
19
|
+
languageOptions: {
|
|
20
|
+
ecmaVersion: 2020,
|
|
21
|
+
globals: globals.browser,
|
|
22
|
+
},
|
|
23
|
+
rules: {
|
|
24
|
+
'react-refresh/only-export-components': [
|
|
25
|
+
'warn',
|
|
26
|
+
{ allowConstantExport: true },
|
|
27
|
+
],
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
|
|
31
|
+
prettier,
|
|
32
|
+
]);
|