@mkappelhof/eslint-config-base 1.0.5 → 1.0.9
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/.eslintrc.yml +5 -5
- package/AGENTS.md +22 -0
- package/CHANGELOG.md +28 -0
- package/LICENSE +21 -0
- package/README.md +8 -0
- package/package.json +9 -9
package/.eslintrc.yml
CHANGED
|
@@ -32,11 +32,11 @@ rules:
|
|
|
32
32
|
- groups:
|
|
33
33
|
- - '^react'
|
|
34
34
|
- "^@?\\w"
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
- '^@(/.*|$)'
|
|
36
|
+
- "^\\u0000"
|
|
37
|
+
- "^\\.\\.(?!/?$)"
|
|
38
38
|
- "^\\.\\./?$"
|
|
39
|
-
|
|
39
|
+
- "^\\./(?=.*/)(?!/?$)"
|
|
40
40
|
- "^\\.(?!/?$)"
|
|
41
41
|
- "^\\./?$"
|
|
42
|
-
|
|
42
|
+
- "^.+\\.s?css$"
|
package/AGENTS.md
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# @mkappelhof/eslint-config-base — agent instructions
|
|
2
|
+
|
|
3
|
+
These are the shared ESLint rules that `@mkappelhof/eslint-config-next`, `-react`, `-node` and `-remix` all build on. Projects don't use this package directly. Its rules apply to every project that uses one of those configs.
|
|
4
|
+
|
|
5
|
+
## Commands
|
|
6
|
+
|
|
7
|
+
- `pnpm eslint .` lints the project.
|
|
8
|
+
- `pnpm eslint --fix <files>` applies auto-fixes, including import sorting.
|
|
9
|
+
|
|
10
|
+
The task is not done while `pnpm eslint` reports errors in the files you changed.
|
|
11
|
+
|
|
12
|
+
## Rules
|
|
13
|
+
|
|
14
|
+
- **No `any`** (`@typescript-eslint/no-explicit-any`). Use `unknown` and narrow it, or write a proper type.
|
|
15
|
+
- **Type-only imports use `import type`** (`@typescript-eslint/consistent-type-imports`).
|
|
16
|
+
- **No unused variables.** Prefix intentionally unused arguments, variables or caught errors with `_` (`_event`, `_err`).
|
|
17
|
+
- **No `console`** (`no-console`). Use the project's logger, or remove debug output before you finish.
|
|
18
|
+
- **Arrow functions use a concise body when they only return a value** (`arrow-body-style: as-needed`): `const f = (x) => x * 2`, not `(x) => { return x * 2; }`.
|
|
19
|
+
- **Imports are sorted** (`simple-import-sort`): React first, then packages, aliases (`@/…`), relative imports, and stylesheets last. Run `eslint --fix` to sort them. Do not sort by hand.
|
|
20
|
+
- Formatting is handled by Prettier (`@mkappelhof/prettier-config`). ESLint does not check style.
|
|
21
|
+
|
|
22
|
+
Do not disable rules with `eslint-disable` comments to make an error go away. If a disable is truly needed, scope it to one line and add a reason: `// eslint-disable-next-line <rule> -- <reason>`.
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# @mkappelhof/eslint-config-base
|
|
2
2
|
|
|
3
|
+
## 1.0.9
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 9665a73: Add an `AGENTS.md` with instructions for AI coding agents, and switch the install docs from yarn to pnpm.
|
|
8
|
+
- Updated dependencies [9665a73]
|
|
9
|
+
- @mkappelhof/prettier-config@1.0.7
|
|
10
|
+
|
|
11
|
+
## 1.0.8
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- 4035554: Add biome config
|
|
16
|
+
|
|
17
|
+
## 1.0.7
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- 7a413a3: Add deployment to Github
|
|
22
|
+
- Updated dependencies [7a413a3]
|
|
23
|
+
- @mkappelhof/prettier-config@1.0.6
|
|
24
|
+
|
|
25
|
+
## 1.0.6
|
|
26
|
+
|
|
27
|
+
### Patch Changes
|
|
28
|
+
|
|
29
|
+
- 3d8ee7b: remove linebreakes between import statements
|
|
30
|
+
|
|
3
31
|
## 1.0.5
|
|
4
32
|
|
|
5
33
|
### Patch Changes
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 Maurice
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -5,3 +5,11 @@ Base ESLint configuration to extend from in other, more specified configurations
|
|
|
5
5
|
- For Next.js projects use [@mkappelhof/eslint-config-next](https://www.npmjs.com/package/@mkappelhof/eslint-config-next)
|
|
6
6
|
- For Node.js projects use [@mkappelhof/eslint-config-node](https://www.npmjs.com/package/@mkappelhof/eslint-config-node)
|
|
7
7
|
- For React projects use [@mkappelhof/eslint-config-react](https://www.npmjs.com/package/@mkappelhof/eslint-config-react)
|
|
8
|
+
|
|
9
|
+
## AI agents
|
|
10
|
+
|
|
11
|
+
This package ships an `AGENTS.md` that describes the conventions this config enforces. Reference it from your project's `AGENTS.md`:
|
|
12
|
+
|
|
13
|
+
```md
|
|
14
|
+
- Follow `node_modules/@mkappelhof/eslint-config-base/AGENTS.md`
|
|
15
|
+
```
|
package/package.json
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mkappelhof/eslint-config-base",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.9",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "git@github.com:mkappelhof/frontend-tools.git",
|
|
7
7
|
"author": "Maurice Kappelhof <maurice@mauricekappelhof.nl>",
|
|
8
|
-
"scripts": {
|
|
9
|
-
"build": "rollup -c",
|
|
10
|
-
"test": "yaml-validator .eslintrc.yml"
|
|
11
|
-
},
|
|
12
8
|
"dependencies": {
|
|
13
|
-
"@mkappelhof/prettier-config": "*",
|
|
14
9
|
"@typescript-eslint/eslint-plugin": "6.3.0",
|
|
15
10
|
"@typescript-eslint/parser": "6.3.0",
|
|
16
11
|
"eslint-config-prettier": "9.0.0",
|
|
17
12
|
"eslint-plugin-prettier": "5.0.0",
|
|
18
13
|
"eslint-plugin-simple-import-sort": "10.0.0",
|
|
19
|
-
"yaml-validator": "5.1.0"
|
|
14
|
+
"yaml-validator": "5.1.0",
|
|
15
|
+
"@mkappelhof/prettier-config": "1.0.7"
|
|
20
16
|
},
|
|
21
17
|
"peerDependencies": {
|
|
22
|
-
"eslint": "
|
|
18
|
+
"eslint": "9.27.0",
|
|
23
19
|
"typescript": "5.1.6"
|
|
20
|
+
},
|
|
21
|
+
"scripts": {
|
|
22
|
+
"build": "rollup -c",
|
|
23
|
+
"test": "yaml-validator .eslintrc.yml"
|
|
24
24
|
}
|
|
25
|
-
}
|
|
25
|
+
}
|