@4mbl/lint 0.0.0-beta.1e25e21
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 +7 -0
- package/README.md +41 -0
- package/package.json +35 -0
- package/src/next.ts +30 -0
package/CHANGELOG.md
ADDED
package/README.md
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# @4mbl/lint
|
|
2
|
+
|
|
3
|
+
> Linting configuration for various environments.
|
|
4
|
+
|
|
5
|
+
* [Usage](#usage)
|
|
6
|
+
* [Available templates](#available-templates)
|
|
7
|
+
* [Versioning](#versioning)
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
Install the [`@4mbl/lint`](https://www.npmjs.com/package/@4mbl/lint) npm package.
|
|
14
|
+
|
|
15
|
+
```shell
|
|
16
|
+
npm install -D @4mbl/lint
|
|
17
|
+
```
|
|
18
|
+
|
|
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
|
+
|
|
21
|
+
```js
|
|
22
|
+
import defaultConfig, { type Config } from '@4mbl/lint/next'; // <-- change `next` to the desired template
|
|
23
|
+
|
|
24
|
+
export default [...defaultConfig] satisfies Config[];
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Available templates
|
|
28
|
+
|
|
29
|
+
There is currently one config template.
|
|
30
|
+
|
|
31
|
+
- **Next** - Linting configuration extending the Next.js default config.
|
|
32
|
+
|
|
33
|
+
## Versioning
|
|
34
|
+
|
|
35
|
+
As of version 4.0.0, the package migrated to a single template per type. The package version is now used to determine the template version. This simplifies both the maintenance and usage of the package.
|
|
36
|
+
|
|
37
|
+
The package follows the following versioning scheme: `X.Y.Z`
|
|
38
|
+
|
|
39
|
+
- `X` - Reserved for linting provider changes as those might cause wider backwards compat issues.
|
|
40
|
+
- `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
|
+
- `Z` - Minor fixes that make the previous release unusable.
|
package/package.json
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@4mbl/lint",
|
|
3
|
+
"version": "0.0.0-beta.1e25e21",
|
|
4
|
+
"description": "Linting configuration for various environments.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"author": "4mbl",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"homepage": "https://github.com/4mbl/config/tree/main/packages/lint#readme",
|
|
9
|
+
"exports": {
|
|
10
|
+
"./next": "./src/next.ts"
|
|
11
|
+
},
|
|
12
|
+
"files": [
|
|
13
|
+
"src",
|
|
14
|
+
"package.json",
|
|
15
|
+
"README.md",
|
|
16
|
+
"CHANGELOG.md"
|
|
17
|
+
],
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "git+https://github.com/4mbl/config.git",
|
|
21
|
+
"directory": "packages/lint"
|
|
22
|
+
},
|
|
23
|
+
"keywords": [
|
|
24
|
+
"lint"
|
|
25
|
+
],
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"@eslint/js": "^9.38.0",
|
|
28
|
+
"eslint": "^9.38.0",
|
|
29
|
+
"eslint-config-next": "^16.0.1",
|
|
30
|
+
"eslint-plugin-react-compiler": "19.1.0-rc.2",
|
|
31
|
+
"jiti": "^2.6.1",
|
|
32
|
+
"typescript-eslint": "^8.46.2"
|
|
33
|
+
},
|
|
34
|
+
"scripts": {}
|
|
35
|
+
}
|
package/src/next.ts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
import js from '@eslint/js';
|
|
3
|
+
import nextVitals from 'eslint-config-next/core-web-vitals';
|
|
4
|
+
import nextTs from 'eslint-config-next/typescript';
|
|
5
|
+
import * as reactCompiler from 'eslint-plugin-react-compiler';
|
|
6
|
+
import { defineConfig, globalIgnores, Config } from 'eslint/config';
|
|
7
|
+
import tseslint from 'typescript-eslint';
|
|
8
|
+
|
|
9
|
+
export { Config };
|
|
10
|
+
|
|
11
|
+
export default defineConfig([
|
|
12
|
+
js.configs.recommended,
|
|
13
|
+
...tseslint.configs.recommended,
|
|
14
|
+
{
|
|
15
|
+
languageOptions: {
|
|
16
|
+
parserOptions: {
|
|
17
|
+
tsconfigRootDir: (import.meta as any).dirname,
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
...nextVitals,
|
|
22
|
+
...nextTs,
|
|
23
|
+
globalIgnores(['.next/**', 'out/**', 'build/**', 'next-env.d.ts']),
|
|
24
|
+
reactCompiler.configs.recommended,
|
|
25
|
+
{
|
|
26
|
+
rules: {
|
|
27
|
+
'react-compiler/react-compiler': 'error',
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
]) satisfies Config[];
|