@viclafouch/eslint-config-viclafouch 4.17.0 → 4.17.1-beta.1

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.
@@ -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
@@ -0,0 +1,3 @@
1
+ import reactHooksConfig from './rules/react-hooks.mjs'
2
+
3
+ export default [reactHooksConfig]
package/imports.mjs ADDED
@@ -0,0 +1,3 @@
1
+ import importsConfig from './rules/imports.mjs'
2
+
3
+ export default [importsConfig]
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,11 +1,12 @@
1
1
  {
2
2
  "name": "@viclafouch/eslint-config-viclafouch",
3
- "version": "4.17.0",
3
+ "version": "4.17.1-beta.1",
4
4
  "description": "ESLint and Prettier Config from Victor de la Fouchardiere",
5
5
  "main": "index.js",
6
6
  "keywords": [
7
7
  "javascript",
8
8
  "ecmascript",
9
+ "eslintconfig",
9
10
  "typescript",
10
11
  "eslint",
11
12
  "config",
@@ -24,21 +25,20 @@
24
25
  "license": "MIT",
25
26
  "homepage": "https://github.com/viclafouch/eslint-config-viclafouch#readme",
26
27
  "peerDependencies": {
27
- "eslint": "^8.57.0",
28
- "prettier": "^3.3.0",
29
- "typescript": "^5.5.0"
28
+ "eslint": ">= 9",
29
+ "prettier": "^3.4.2",
30
+ "typescript": "^5.7.2"
30
31
  },
31
32
  "dependencies": {
32
33
  "@babel/core": "^7.26.0",
33
34
  "@babel/eslint-parser": "^7.25.9",
34
- "@next/eslint-plugin-next": "^15.0.4",
35
+ "@next/eslint-plugin-next": "^15.1.0",
35
36
  "@rushstack/eslint-patch": "^1.10.4",
36
37
  "@total-typescript/ts-reset": "^0.6.1",
37
- "@typescript-eslint/eslint-plugin": "^8.17.0",
38
- "@typescript-eslint/parser": "^8.17.0",
38
+ "@typescript-eslint/eslint-plugin": "^8.18.0",
39
+ "@typescript-eslint/parser": "^8.18.0",
39
40
  "app-root-path": "^3.1.0",
40
41
  "babel-loader": "^9.2.1",
41
- "eslint": "^8.57.0",
42
42
  "eslint-config-prettier": "^9.1.0",
43
43
  "eslint-plugin-import": "^2.31.0",
44
44
  "eslint-plugin-jsx-a11y": "^6.10.2",
@@ -49,9 +49,11 @@
49
49
  "eslint-plugin-simple-import-sort": "^12.1.1",
50
50
  "eslint-plugin-testing-library": "^7.1.1",
51
51
  "get-tsconfig": "^4.8.1",
52
+ "globals": "^15.13.0",
52
53
  "prettier": "^3.4.2",
53
- "typescript": "^5.7.2",
54
- "prettier-plugin-curly": "^0.3.1"
54
+ "prettier-plugin-curly": "^0.3.1",
55
+ "eslint": "^9.17.0",
56
+ "typescript": "^5.7.2"
55
57
  },
56
58
  "scripts": {
57
59
  "lint": "eslint .",
@@ -60,5 +62,11 @@
60
62
  "publish": "npm publish",
61
63
  "bump:beta": "npm version prerelease --preid beta",
62
64
  "publish:beta": "npm publish --tag beta"
65
+ },
66
+ "devDependencies": {
67
+ "@eslint/js": "^9.17.0",
68
+ "eslint": "^9.17.0",
69
+ "typescript": "^5.7.2",
70
+ "typescript-eslint": "^8.18.0"
63
71
  }
64
72
  }
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
@@ -0,0 +1,3 @@
1
+ import reactConfig from './rules/react.mjs'
2
+
3
+ export default [...reactConfig]
@@ -1,9 +1,14 @@
1
+ import globals from 'globals'
2
+
1
3
  /**
2
4
  * @type {import("eslint").Linter.Config}
3
5
  */
4
- module.exports = {
5
- env: {
6
- browser: true
6
+ export default {
7
+ files: ['**/*.{js,mjs,cjs,jsx}'],
8
+ languageOptions: {
9
+ globals: {
10
+ ...globals.browser
11
+ }
7
12
  },
8
13
  rules: {
9
14
  // enforces getter/setter pairs in objects
@@ -1,7 +1,8 @@
1
1
  /**
2
2
  * @type {import("eslint").Linter.Config}
3
3
  */
4
- module.exports = {
4
+ export default {
5
+ files: ['**/*.{js,mjs,cjs,jsx}'],
5
6
  rules: {
6
7
  // Disallow await inside of loops
7
8
  // https://eslint.org/docs/rules/no-await-in-loop
@@ -1,13 +1,20 @@
1
+ import pluginPromise from 'eslint-plugin-promise'
2
+
1
3
  /**
2
4
  * @type {import("eslint").Linter.Config}
3
5
  */
4
- module.exports = {
5
- plugins: ['promise'],
6
- env: {
7
- es6: true
6
+ export default {
7
+ files: ['**/*.{js,mjs,cjs,jsx}'],
8
+ plugins: {
9
+ promise: pluginPromise
8
10
  },
9
- parserOptions: {
10
- ecmaVersion: 6,
11
+ languageOptions: {
12
+ parserOptions: {
13
+ ecmaFeatures: {
14
+ jsx: true
15
+ }
16
+ },
17
+ ecmaVersion: 2022,
11
18
  sourceType: 'module'
12
19
  },
13
20
  rules: {
@@ -1,5 +1,7 @@
1
- const { getTsconfig } = require('get-tsconfig')
2
- const appRoot = require('app-root-path')
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,15 @@ if (tsConfig && tsConfig.config.compilerOptions.paths) {
21
23
  /**
22
24
  * @type {import("eslint").Linter.Config}
23
25
  */
24
- module.exports = {
25
- parserOptions: {
26
+ export default {
27
+ files: ['**/*.{js,mjs,cjs,jsx}'],
28
+ languageOptions: {
26
29
  sourceType: 'module'
27
30
  },
28
- env: {
29
- es6: true
31
+ plugins: {
32
+ 'simple-import-sort': simpleImportSort,
33
+ import: importPlugin
30
34
  },
31
- plugins: ['simple-import-sort', 'import'],
32
35
  rules: {
33
36
  'simple-import-sort/exports': 'error',
34
37
  'import/first': 'error',
@@ -1,10 +1,15 @@
1
+ import globals from 'globals'
2
+
1
3
  /**
2
4
  * @type {import("eslint").Linter.Config}
3
5
  */
4
- module.exports = {
5
- env: {
6
- node: true,
7
- jest: true
6
+ export default {
7
+ files: ['**/*.{js,mjs,cjs,jsx}'],
8
+ languageOptions: {
9
+ globals: {
10
+ ...globals.node,
11
+ ...globals.jest
12
+ }
8
13
  },
9
14
  rules: {
10
15
  // 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
- module.exports = {
5
- plugins: ['react-hooks'],
6
- parserOptions: {
7
- ecmaFeatures: {
8
- jsx: true
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: {