@bekaert-dev/eslint-config 1.0.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/LICENSE +21 -0
- package/README.md +65 -0
- package/dist/base.js +20 -0
- package/dist/next.js +16 -0
- package/dist/react.js +34 -0
- package/package.json +40 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Bekaert.dev
|
|
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
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# @bekaert-dev/eslint-config
|
|
2
|
+
|
|
3
|
+
Shared ESLint Flat Config presets for Bekaert.dev projects.
|
|
4
|
+
|
|
5
|
+
This package is ESM-only and targets ESLint v9 (Flat Config).
|
|
6
|
+
|
|
7
|
+
## Requirements
|
|
8
|
+
|
|
9
|
+
- ESLint v9 (Flat Config)
|
|
10
|
+
|
|
11
|
+
## Install
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
pnpm add -D @bekaert-dev/eslint-config eslint
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Presets
|
|
18
|
+
|
|
19
|
+
- `@bekaert-dev/eslint-config` (alias to `@bekaert-dev/eslint-config/base`)
|
|
20
|
+
- `@bekaert-dev/eslint-config/react`
|
|
21
|
+
- `@bekaert-dev/eslint-config/next`
|
|
22
|
+
|
|
23
|
+
## Usage
|
|
24
|
+
|
|
25
|
+
Create or update your `eslint.config.js`:
|
|
26
|
+
|
|
27
|
+
```js
|
|
28
|
+
import baseConfig from '@bekaert-dev/eslint-config'
|
|
29
|
+
|
|
30
|
+
export default [...baseConfig]
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
React preset:
|
|
34
|
+
|
|
35
|
+
```js
|
|
36
|
+
import reactConfig from '@bekaert-dev/eslint-config/react'
|
|
37
|
+
|
|
38
|
+
export default [...reactConfig]
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Next.js preset:
|
|
42
|
+
|
|
43
|
+
```js
|
|
44
|
+
import nextConfig from '@bekaert-dev/eslint-config/next'
|
|
45
|
+
|
|
46
|
+
export default [...nextConfig]
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Notes
|
|
50
|
+
|
|
51
|
+
- These presets already include recommended rules for ESLint core and TypeScript.
|
|
52
|
+
- The presets are meant to be used as-is; extend by appending your own config objects:
|
|
53
|
+
|
|
54
|
+
```js
|
|
55
|
+
import baseConfig from '@bekaert-dev/eslint-config/base'
|
|
56
|
+
|
|
57
|
+
export default [
|
|
58
|
+
...baseConfig,
|
|
59
|
+
{
|
|
60
|
+
rules: {
|
|
61
|
+
// your overrides
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
]
|
|
65
|
+
```
|
package/dist/base.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import js from '@eslint/js';
|
|
2
|
+
import tseslint from 'typescript-eslint';
|
|
3
|
+
const baseConfig = [
|
|
4
|
+
js.configs.recommended,
|
|
5
|
+
...tseslint.configs.recommended,
|
|
6
|
+
{
|
|
7
|
+
languageOptions: {
|
|
8
|
+
ecmaVersion: 'latest',
|
|
9
|
+
sourceType: 'module',
|
|
10
|
+
},
|
|
11
|
+
ignores: [
|
|
12
|
+
'**/.next/**',
|
|
13
|
+
'**/.turbo/**',
|
|
14
|
+
'**/build/**',
|
|
15
|
+
'**/dist/**',
|
|
16
|
+
'**/node_modules/**',
|
|
17
|
+
],
|
|
18
|
+
},
|
|
19
|
+
];
|
|
20
|
+
export default baseConfig;
|
package/dist/next.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import next from '@next/eslint-plugin-next';
|
|
2
|
+
import reactConfig from './react.js';
|
|
3
|
+
const nextConfig = [
|
|
4
|
+
...reactConfig,
|
|
5
|
+
{
|
|
6
|
+
files: ['**/*.{js,jsx,ts,tsx}'],
|
|
7
|
+
plugins: {
|
|
8
|
+
'@next/next': next,
|
|
9
|
+
},
|
|
10
|
+
rules: {
|
|
11
|
+
...next.configs.recommended.rules,
|
|
12
|
+
...next.configs['core-web-vitals'].rules,
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
];
|
|
16
|
+
export default nextConfig;
|
package/dist/react.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import jsxA11y from 'eslint-plugin-jsx-a11y';
|
|
2
|
+
import react from 'eslint-plugin-react';
|
|
3
|
+
import reactHooks from 'eslint-plugin-react-hooks';
|
|
4
|
+
import baseConfig from './base.js';
|
|
5
|
+
const reactConfig = [
|
|
6
|
+
...baseConfig,
|
|
7
|
+
{
|
|
8
|
+
files: ['**/*.{jsx,tsx}'],
|
|
9
|
+
languageOptions: {
|
|
10
|
+
parserOptions: {
|
|
11
|
+
ecmaFeatures: {
|
|
12
|
+
jsx: true,
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
plugins: {
|
|
17
|
+
react,
|
|
18
|
+
'react-hooks': reactHooks,
|
|
19
|
+
'jsx-a11y': jsxA11y,
|
|
20
|
+
},
|
|
21
|
+
settings: {
|
|
22
|
+
react: {
|
|
23
|
+
version: 'detect',
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
rules: {
|
|
27
|
+
...react.configs.recommended.rules,
|
|
28
|
+
...react.configs['jsx-runtime'].rules,
|
|
29
|
+
...reactHooks.configs.recommended.rules,
|
|
30
|
+
...jsxA11y.configs.recommended.rules,
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
];
|
|
34
|
+
export default reactConfig;
|
package/package.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@bekaert-dev/eslint-config",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"homepage": "https://github.com/bekaert-dev/monorepo/tree/main/packages/eslint-config",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"publishConfig": {
|
|
8
|
+
"access": "public"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"dist/**"
|
|
12
|
+
],
|
|
13
|
+
"main": "./dist/base.js",
|
|
14
|
+
"exports": {
|
|
15
|
+
"./base": "./dist/base.js",
|
|
16
|
+
"./react": "./dist/react.js",
|
|
17
|
+
"./next": "./dist/next.js"
|
|
18
|
+
},
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "https://github.com/bekaert-dev/monorepo",
|
|
22
|
+
"directory": "packages/eslint-config"
|
|
23
|
+
},
|
|
24
|
+
"dependencies": {
|
|
25
|
+
"@eslint/js": "^9.39.0",
|
|
26
|
+
"@next/eslint-plugin-next": "^16.1.6",
|
|
27
|
+
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
28
|
+
"eslint-plugin-react": "^7.37.4",
|
|
29
|
+
"eslint-plugin-react-hooks": "^5.2.0",
|
|
30
|
+
"typescript-eslint": "^8.54.0",
|
|
31
|
+
"@bekaert-dev/tsconfig": "1.0.0"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"typescript": "^5.9.3",
|
|
35
|
+
"@types/eslint-plugin-jsx-a11y": "^6.10.1"
|
|
36
|
+
},
|
|
37
|
+
"scripts": {
|
|
38
|
+
"build": "tsc -p tsconfig.json"
|
|
39
|
+
}
|
|
40
|
+
}
|