@4mbl/lint 0.0.0-beta.afda011 → 0.0.0-beta.bac5232
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 +57 -0
- package/README.md +25 -8
- package/package.json +13 -7
- package/src/next.ts +7 -3
- package/src/node.ts +14 -0
- package/src/react.ts +34 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,62 @@
|
|
|
1
1
|
# @4mbl/lint
|
|
2
2
|
|
|
3
|
+
## 0.6.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 46d0443: Upgrade config dependencies
|
|
8
|
+
|
|
9
|
+
## 0.5.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- 55c3db6: Export `defineConfig` from eslint
|
|
14
|
+
- f7d30bb: Upgrade config dependencies
|
|
15
|
+
|
|
16
|
+
## 0.4.0
|
|
17
|
+
|
|
18
|
+
### Minor Changes
|
|
19
|
+
|
|
20
|
+
- 00cfefd: Add node template
|
|
21
|
+
|
|
22
|
+
## 0.3.2
|
|
23
|
+
|
|
24
|
+
### Patch Changes
|
|
25
|
+
|
|
26
|
+
- df1c48b: Re-export eslint Config type from react template
|
|
27
|
+
|
|
28
|
+
## 0.3.1
|
|
29
|
+
|
|
30
|
+
### Patch Changes
|
|
31
|
+
|
|
32
|
+
- d17fc69: Fix react template export
|
|
33
|
+
|
|
34
|
+
## 0.3.0
|
|
35
|
+
|
|
36
|
+
### Minor Changes
|
|
37
|
+
|
|
38
|
+
- 6d969e6: Add react template
|
|
39
|
+
- 6d969e6: Upgrade eslint and config dependencies
|
|
40
|
+
|
|
41
|
+
## 0.2.1
|
|
42
|
+
|
|
43
|
+
### Patch Changes
|
|
44
|
+
|
|
45
|
+
- 3a223fe: Use flat config version of eslint-plugin-react-hooks
|
|
46
|
+
|
|
47
|
+
## 0.2.0
|
|
48
|
+
|
|
49
|
+
### Minor Changes
|
|
50
|
+
|
|
51
|
+
- c4e49f3: Add eslint-plugin-react-hooks
|
|
52
|
+
- c4e49f3: Add eslint-config-prettier
|
|
53
|
+
|
|
54
|
+
## 0.1.1
|
|
55
|
+
|
|
56
|
+
### Patch Changes
|
|
57
|
+
|
|
58
|
+
- 2c91355: Move dependencies not to be dev-only
|
|
59
|
+
|
|
3
60
|
## 0.1.0
|
|
4
61
|
|
|
5
62
|
### 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
|
|
@@ -19,23 +19,40 @@ npm install -D @4mbl/lint
|
|
|
19
19
|
Create a `eslint.config.ts` file in the root of your project with the desired configuration. This package currently uses eslint. That might change in a future major release.
|
|
20
20
|
|
|
21
21
|
```js
|
|
22
|
-
import defaultConfig, {
|
|
22
|
+
import defaultConfig, { defineConfig } from '@4mbl/lint/next'; // <-- change `next` to the desired template
|
|
23
23
|
|
|
24
|
-
export default [...defaultConfig]
|
|
24
|
+
export default defineConfig([...defaultConfig]);
|
|
25
|
+
```
|
|
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
|
|
25
40
|
```
|
|
26
41
|
|
|
27
42
|
## Available templates
|
|
28
43
|
|
|
29
|
-
|
|
44
|
+
These are the currently available config templates.
|
|
30
45
|
|
|
31
|
-
- **Next** -
|
|
46
|
+
- **Next** - Extending the Next.js linting config.
|
|
47
|
+
- **Node** - Linting configuration for Node.js.
|
|
48
|
+
- **React** - Extending the Vite-React linting config.
|
|
32
49
|
|
|
33
50
|
## Versioning
|
|
34
51
|
|
|
35
|
-
|
|
52
|
+
_Until v1.0.0 is released, breaking changes may be introduced in minor releases without prior warnings._
|
|
36
53
|
|
|
37
|
-
The package follows the following versioning scheme: `X.Y.Z
|
|
54
|
+
The package follows the following versioning scheme: `X.Y.Z`.
|
|
38
55
|
|
|
39
|
-
- `X` - Reserved for linting provider changes as those might cause wider backwards
|
|
56
|
+
- `X` - Reserved for linting provider changes as those might cause wider backwards compatibility issues.
|
|
40
57
|
- `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
58
|
- `Z` - Minor fixes that make the previous release unusable.
|
package/package.json
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@4mbl/lint",
|
|
3
|
-
"version": "0.0.0-beta.
|
|
3
|
+
"version": "0.0.0-beta.bac5232",
|
|
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
|
+
"./node": "./src/node.ts",
|
|
12
|
+
"./react": "./src/react.ts"
|
|
11
13
|
},
|
|
12
14
|
"files": [
|
|
13
15
|
"src",
|
|
@@ -23,13 +25,17 @@
|
|
|
23
25
|
"keywords": [
|
|
24
26
|
"lint"
|
|
25
27
|
],
|
|
26
|
-
"
|
|
27
|
-
"@eslint/js": "^9.
|
|
28
|
-
"eslint": "^9.
|
|
29
|
-
"eslint-config-next": "^16.0.
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"@eslint/js": "^9.39.1",
|
|
30
|
+
"eslint": "^9.39.1",
|
|
31
|
+
"eslint-config-next": "^16.0.10",
|
|
32
|
+
"eslint-config-prettier": "^10.1.8",
|
|
30
33
|
"eslint-plugin-react-compiler": "19.1.0-rc.2",
|
|
34
|
+
"eslint-plugin-react-hooks": "^7.0.1",
|
|
35
|
+
"eslint-plugin-react-refresh": "^0.4.24",
|
|
36
|
+
"globals": "^16.5.0",
|
|
31
37
|
"jiti": "^2.6.1",
|
|
32
|
-
"typescript-eslint": "^8.
|
|
38
|
+
"typescript-eslint": "^8.48.1"
|
|
33
39
|
},
|
|
34
40
|
"scripts": {}
|
|
35
41
|
}
|
package/src/next.ts
CHANGED
|
@@ -2,11 +2,13 @@
|
|
|
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 { type Config, defineConfig, globalIgnores } from 'eslint/config';
|
|
7
9
|
import tseslint from 'typescript-eslint';
|
|
8
10
|
|
|
9
|
-
export { Config };
|
|
11
|
+
export { type Config, defineConfig };
|
|
10
12
|
|
|
11
13
|
export default defineConfig([
|
|
12
14
|
js.configs.recommended,
|
|
@@ -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/node.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import js from '@eslint/js';
|
|
2
|
+
import { defineConfig, globalIgnores, type Config } from 'eslint/config';
|
|
3
|
+
import globals from 'globals';
|
|
4
|
+
import tseslint from 'typescript-eslint';
|
|
5
|
+
|
|
6
|
+
export { type Config, defineConfig };
|
|
7
|
+
|
|
8
|
+
export default defineConfig([
|
|
9
|
+
globalIgnores(['dist/**']),
|
|
10
|
+
{ files: ['**/*.{js,mjs,cjs,ts}'] },
|
|
11
|
+
{ languageOptions: { globals: globals.node } },
|
|
12
|
+
js.configs.recommended,
|
|
13
|
+
...tseslint.configs.recommended,
|
|
14
|
+
]) satisfies Config[];
|
package/src/react.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
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, type Config } from 'eslint/config';
|
|
6
|
+
import globals from 'globals';
|
|
7
|
+
import tseslint from 'typescript-eslint';
|
|
8
|
+
|
|
9
|
+
export { type Config, defineConfig };
|
|
10
|
+
|
|
11
|
+
export default defineConfig([
|
|
12
|
+
js.configs.recommended,
|
|
13
|
+
tseslint.configs.recommended,
|
|
14
|
+
|
|
15
|
+
reactHooks.configs.flat.recommended,
|
|
16
|
+
reactRefresh.configs.recommended,
|
|
17
|
+
|
|
18
|
+
globalIgnores(['dist']),
|
|
19
|
+
{
|
|
20
|
+
files: ['**/*.{ts,tsx}'],
|
|
21
|
+
languageOptions: {
|
|
22
|
+
ecmaVersion: 2020,
|
|
23
|
+
globals: globals.browser,
|
|
24
|
+
},
|
|
25
|
+
rules: {
|
|
26
|
+
'react-refresh/only-export-components': [
|
|
27
|
+
'warn',
|
|
28
|
+
{ allowConstantExport: true },
|
|
29
|
+
],
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
|
|
33
|
+
prettier,
|
|
34
|
+
]) satisfies Config[];
|