@viclafouch/eslint-config-viclafouch 4.17.0 → 4.17.1-beta.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/eslint.config.mjs +16 -0
- package/hooks.mjs +3 -0
- package/imports.mjs +3 -0
- package/index.mjs +20 -0
- package/next.mjs +35 -0
- package/package.json +17 -10
- package/prettier.mjs +27 -0
- package/react.mjs +3 -0
- package/rules/{best-practices.js → best-practices.mjs} +7 -3
- package/rules/{errors.js → errors.mjs} +1 -1
- package/rules/{es6.js → es6.mjs} +7 -6
- package/rules/{imports.js → imports.mjs} +9 -7
- package/rules/{node.js → node.mjs} +8 -4
- package/rules/{react-hooks.js → react-hooks.mjs} +12 -5
- package/rules/react.mjs +411 -0
- package/rules/{style.js → style.mjs} +1 -1
- package/rules/typescript.mjs +203 -0
- package/rules/{variables.js → variables.mjs} +1 -1
- package/typescript.mjs +6 -0
- package/.eslintrc +0 -10
- package/hooks.js +0 -7
- package/imports.js +0 -7
- package/index.js +0 -22
- package/next.js +0 -19
- package/prettier.js +0 -24
- package/react.js +0 -7
- package/rules/react.js +0 -399
- package/rules/typescript.js +0 -199
- package/typescript.js +0 -10
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import baseConfig from './index.mjs'
|
|
2
|
+
import prettierConfig from './prettier.mjs'
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @type {import("eslint").Linter.Config}
|
|
6
|
+
*/
|
|
7
|
+
export default [
|
|
8
|
+
...baseConfig,
|
|
9
|
+
...prettierConfig,
|
|
10
|
+
{
|
|
11
|
+
rules: {
|
|
12
|
+
'comma-dangle': 0,
|
|
13
|
+
'max-len': 0
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
]
|
package/hooks.mjs
ADDED
package/imports.mjs
ADDED
package/index.mjs
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import bestPracticesConfig from './rules/best-practices.mjs'
|
|
2
|
+
import errorConfig from './rules/errors.mjs'
|
|
3
|
+
import es6Config from './rules/es6.mjs'
|
|
4
|
+
import importsConfig from './rules/imports.mjs'
|
|
5
|
+
import nodeConfig from './rules/node.mjs'
|
|
6
|
+
import styleConfig from './rules/style.mjs'
|
|
7
|
+
import variablesConfig from './rules/variables.mjs'
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* @type {import("eslint").Linter.Config}
|
|
11
|
+
*/
|
|
12
|
+
export default [
|
|
13
|
+
bestPracticesConfig,
|
|
14
|
+
nodeConfig,
|
|
15
|
+
errorConfig,
|
|
16
|
+
importsConfig,
|
|
17
|
+
styleConfig,
|
|
18
|
+
variablesConfig,
|
|
19
|
+
es6Config
|
|
20
|
+
]
|
package/next.mjs
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { FlatCompat } from '@eslint/eslintrc'
|
|
2
|
+
import hooksConfig from './hooks.mjs'
|
|
3
|
+
import reactConfig from './react.mjs'
|
|
4
|
+
|
|
5
|
+
const compat = new FlatCompat({
|
|
6
|
+
baseDirectory: import.meta.dirname
|
|
7
|
+
})
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* @type {import("eslint").Linter.Config}
|
|
11
|
+
*/
|
|
12
|
+
export default [
|
|
13
|
+
...reactConfig,
|
|
14
|
+
...hooksConfig,
|
|
15
|
+
...compat.config({
|
|
16
|
+
extends: ['plugin:@next/next/recommended'],
|
|
17
|
+
rules: {
|
|
18
|
+
'react/no-unescaped-entities': 'off',
|
|
19
|
+
'@next/next/no-page-custom-font': 'off'
|
|
20
|
+
}
|
|
21
|
+
}),
|
|
22
|
+
{
|
|
23
|
+
rules: {
|
|
24
|
+
// No error for anchor inside a Next Link
|
|
25
|
+
'jsx-a11y/anchor-is-valid': [
|
|
26
|
+
'error',
|
|
27
|
+
{
|
|
28
|
+
components: ['Link'],
|
|
29
|
+
specialLink: ['hrefLeft', 'hrefRight'],
|
|
30
|
+
aspects: ['invalidHref', 'preferButton']
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@viclafouch/eslint-config-viclafouch",
|
|
3
|
-
"version": "4.17.0",
|
|
3
|
+
"version": "4.17.1-beta.0",
|
|
4
4
|
"description": "ESLint and Prettier Config from Victor de la Fouchardiere",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"keywords": [
|
|
@@ -24,21 +24,20 @@
|
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"homepage": "https://github.com/viclafouch/eslint-config-viclafouch#readme",
|
|
26
26
|
"peerDependencies": {
|
|
27
|
-
"eslint": "^
|
|
28
|
-
"prettier": "^3.
|
|
29
|
-
"typescript": "^5.
|
|
27
|
+
"eslint": "^9.16.0",
|
|
28
|
+
"prettier": "^3.4.2",
|
|
29
|
+
"typescript": "^5.7.2"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@babel/core": "^7.26.0",
|
|
33
33
|
"@babel/eslint-parser": "^7.25.9",
|
|
34
|
-
"@next/eslint-plugin-next": "^15.0
|
|
34
|
+
"@next/eslint-plugin-next": "^15.1.0",
|
|
35
35
|
"@rushstack/eslint-patch": "^1.10.4",
|
|
36
36
|
"@total-typescript/ts-reset": "^0.6.1",
|
|
37
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
38
|
-
"@typescript-eslint/parser": "^8.
|
|
37
|
+
"@typescript-eslint/eslint-plugin": "^8.18.0",
|
|
38
|
+
"@typescript-eslint/parser": "^8.18.0",
|
|
39
39
|
"app-root-path": "^3.1.0",
|
|
40
40
|
"babel-loader": "^9.2.1",
|
|
41
|
-
"eslint": "^8.57.0",
|
|
42
41
|
"eslint-config-prettier": "^9.1.0",
|
|
43
42
|
"eslint-plugin-import": "^2.31.0",
|
|
44
43
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
@@ -49,9 +48,11 @@
|
|
|
49
48
|
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
50
49
|
"eslint-plugin-testing-library": "^7.1.1",
|
|
51
50
|
"get-tsconfig": "^4.8.1",
|
|
51
|
+
"globals": "^15.13.0",
|
|
52
52
|
"prettier": "^3.4.2",
|
|
53
|
-
"
|
|
54
|
-
"
|
|
53
|
+
"prettier-plugin-curly": "^0.3.1",
|
|
54
|
+
"eslint": "^9.17.0",
|
|
55
|
+
"typescript": "^5.7.2"
|
|
55
56
|
},
|
|
56
57
|
"scripts": {
|
|
57
58
|
"lint": "eslint .",
|
|
@@ -60,5 +61,11 @@
|
|
|
60
61
|
"publish": "npm publish",
|
|
61
62
|
"bump:beta": "npm version prerelease --preid beta",
|
|
62
63
|
"publish:beta": "npm publish --tag beta"
|
|
64
|
+
},
|
|
65
|
+
"devDependencies": {
|
|
66
|
+
"@eslint/js": "^9.17.0",
|
|
67
|
+
"eslint": "^9.17.0",
|
|
68
|
+
"typescript": "^5.7.2",
|
|
69
|
+
"typescript-eslint": "^8.18.0"
|
|
63
70
|
}
|
|
64
71
|
}
|
package/prettier.mjs
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @type {import("eslint").Linter.Config}
|
|
5
|
+
*/
|
|
6
|
+
export default [
|
|
7
|
+
{
|
|
8
|
+
...eslintPluginPrettierRecommended,
|
|
9
|
+
rules: {
|
|
10
|
+
'prettier/prettier': [
|
|
11
|
+
'error',
|
|
12
|
+
{
|
|
13
|
+
plugins: ['prettier-plugin-curly'],
|
|
14
|
+
semi: false,
|
|
15
|
+
singleQuote: true,
|
|
16
|
+
printWidth: 80,
|
|
17
|
+
tabWidth: 2,
|
|
18
|
+
jsxSingleQuote: false,
|
|
19
|
+
trailingComma: 'none',
|
|
20
|
+
endOfLine: 'auto',
|
|
21
|
+
bracketSameLine: false,
|
|
22
|
+
arrowParens: 'always'
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
]
|
package/react.mjs
ADDED
|
@@ -1,9 +1,13 @@
|
|
|
1
|
+
import globals from 'globals'
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* @type {import("eslint").Linter.Config}
|
|
3
5
|
*/
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
export default {
|
|
7
|
+
languageOptions: {
|
|
8
|
+
globals: {
|
|
9
|
+
...globals.browser
|
|
10
|
+
}
|
|
7
11
|
},
|
|
8
12
|
rules: {
|
|
9
13
|
// enforces getter/setter pairs in objects
|
package/rules/{es6.js → es6.mjs}
RENAMED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
+
import pluginPromise from 'eslint-plugin-promise'
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* @type {import("eslint").Linter.Config}
|
|
3
5
|
*/
|
|
4
|
-
|
|
5
|
-
plugins:
|
|
6
|
-
|
|
7
|
-
es6: true
|
|
6
|
+
export default {
|
|
7
|
+
plugins: {
|
|
8
|
+
promise: pluginPromise
|
|
8
9
|
},
|
|
9
|
-
|
|
10
|
-
ecmaVersion:
|
|
10
|
+
languageOptions: {
|
|
11
|
+
ecmaVersion: 2022,
|
|
11
12
|
sourceType: 'module'
|
|
12
13
|
},
|
|
13
14
|
rules: {
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import appRoot from 'app-root-path'
|
|
2
|
+
import importPlugin from 'eslint-plugin-import'
|
|
3
|
+
import simpleImportSort from 'eslint-plugin-simple-import-sort'
|
|
4
|
+
import { getTsconfig } from 'get-tsconfig'
|
|
3
5
|
|
|
4
6
|
function extractPaths(paths) {
|
|
5
7
|
return Object.keys(paths).map((key) => {
|
|
@@ -21,14 +23,14 @@ if (tsConfig && tsConfig.config.compilerOptions.paths) {
|
|
|
21
23
|
/**
|
|
22
24
|
* @type {import("eslint").Linter.Config}
|
|
23
25
|
*/
|
|
24
|
-
|
|
25
|
-
|
|
26
|
+
export default {
|
|
27
|
+
languageOptions: {
|
|
26
28
|
sourceType: 'module'
|
|
27
29
|
},
|
|
28
|
-
|
|
29
|
-
|
|
30
|
+
plugins: {
|
|
31
|
+
'simple-import-sort': simpleImportSort,
|
|
32
|
+
import: importPlugin
|
|
30
33
|
},
|
|
31
|
-
plugins: ['simple-import-sort', 'import'],
|
|
32
34
|
rules: {
|
|
33
35
|
'simple-import-sort/exports': 'error',
|
|
34
36
|
'import/first': 'error',
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
+
import globals from 'globals'
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* @type {import("eslint").Linter.Config}
|
|
3
5
|
*/
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
export default {
|
|
7
|
+
languageOptions: {
|
|
8
|
+
globals: {
|
|
9
|
+
...globals.node,
|
|
10
|
+
...globals.jest
|
|
11
|
+
}
|
|
8
12
|
},
|
|
9
13
|
rules: {
|
|
10
14
|
// require all requires be top-level
|
|
@@ -1,11 +1,18 @@
|
|
|
1
|
+
import pluginReact from 'eslint-plugin-react'
|
|
2
|
+
import pluginReactHooks from 'eslint-plugin-react-hooks'
|
|
3
|
+
import globals from 'globals'
|
|
4
|
+
|
|
1
5
|
/**
|
|
2
6
|
* @type {import("eslint").Linter.Config}
|
|
3
7
|
*/
|
|
4
|
-
|
|
5
|
-
plugins:
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
export default {
|
|
9
|
+
plugins: {
|
|
10
|
+
'react-hooks': pluginReactHooks
|
|
11
|
+
},
|
|
12
|
+
languageOptions: {
|
|
13
|
+
...pluginReact.configs.flat.recommended.languageOptions,
|
|
14
|
+
globals: {
|
|
15
|
+
...globals.serviceworker
|
|
9
16
|
}
|
|
10
17
|
},
|
|
11
18
|
rules: {
|