eslint-config-gits 5.0.1 → 5.0.2

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 CHANGED
@@ -1,3 +1,10 @@
1
+ ## [5.0.2](https://gitlab.com/geenen-it-systeme/eslint-preset/compare/v5.0.1...v5.0.2) (2024-08-22)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * Migrate to eslint 9 config schema ([f1a4847](https://gitlab.com/geenen-it-systeme/eslint-preset/commit/f1a4847120a47691c2606d8d1e1d250290a7b87c))
7
+
1
8
  ## [5.0.1](https://gitlab.com/geenen-it-systeme/eslint-preset/compare/v5.0.0...v5.0.1) (2024-08-22)
2
9
 
3
10
 
package/index.mjs ADDED
@@ -0,0 +1,104 @@
1
+ import {fixupConfigRules, fixupPluginRules} from "@eslint/compat";
2
+ import react from "eslint-plugin-react";
3
+ import typescriptEslint from "@typescript-eslint/eslint-plugin";
4
+ import prettier from "eslint-plugin-prettier";
5
+ import reactHooks from "eslint-plugin-react-hooks";
6
+ import tsParser from "@typescript-eslint/parser";
7
+ import path from "node:path";
8
+ import {fileURLToPath} from "node:url";
9
+ import js from "@eslint/js";
10
+ import {FlatCompat} from "@eslint/eslintrc";
11
+
12
+ const __filename = fileURLToPath(import.meta.url);
13
+ const __dirname = path.dirname(__filename);
14
+ const compat = new FlatCompat({
15
+ baseDirectory: __dirname,
16
+ recommendedConfig: js.configs.recommended,
17
+ allConfig: js.configs.all
18
+ });
19
+
20
+ export default [
21
+ ...fixupConfigRules(compat.extends(
22
+ "eslint:recommended",
23
+ "plugin:react/recommended",
24
+ "plugin:@typescript-eslint/recommended",
25
+ "plugin:react-hooks/recommended",
26
+ )),
27
+ {
28
+ plugins: {
29
+ react: fixupPluginRules(react),
30
+ "@typescript-eslint": fixupPluginRules(typescriptEslint),
31
+ prettier,
32
+ "react-hooks": fixupPluginRules(reactHooks),
33
+ },
34
+ languageOptions: {
35
+ parser: tsParser,
36
+ ecmaVersion: "latest",
37
+ sourceType: "module",
38
+ parserOptions: {
39
+ ecmaFeatures: {
40
+ jsx: true,
41
+ },
42
+ },
43
+ },
44
+ rules: {
45
+ "no-undefined": "error",
46
+ "prettier/prettier": ["error", {
47
+ tabWidth: 4,
48
+ useTabs: false,
49
+ printWidth: 80,
50
+ semi: true,
51
+ singleQuote: true,
52
+ quoteProps: "as-needed",
53
+ jsxSingleQuote: false,
54
+ trailingComma: "es5",
55
+ bracketSpacing: true,
56
+ bracketSameLine: false,
57
+ arrowParens: "avoid",
58
+ }],
59
+ "@typescript-eslint/explicit-function-return-type": "off",
60
+ "@typescript-eslint/no-inferrable-types": "off",
61
+ "@typescript-eslint/typedef": ["error", {
62
+ arrayDestructuring: false,
63
+ arrowParameter: false,
64
+ memberVariableDeclaration: true,
65
+ objectDestructuring: false,
66
+ parameter: false,
67
+ propertyDeclaration: true,
68
+ variableDeclaration: true,
69
+ variableDeclarationIgnoreFunction: false,
70
+ }],
71
+ "@typescript-eslint/no-unused-vars": "error",
72
+ "default-param-last": ["error"],
73
+ },
74
+ },
75
+ {
76
+ files: ["**/*.ts", "**/*.tsx"],
77
+ rules: {
78
+ "@typescript-eslint/explicit-function-return-type": ["error"],
79
+ "react/jsx-curly-brace-presence": ["error", {
80
+ props: "never",
81
+ children: "never",
82
+ }],
83
+ "arrow-body-style": ["error", "as-needed"],
84
+ },
85
+ },
86
+ {
87
+ files: ["**/*.json"],
88
+ rules: {
89
+ "prettier/prettier": "off",
90
+ },
91
+ }, {
92
+ files: ["**/*.stories.*"],
93
+ rules: {
94
+ "import/no-anonymous-default-export": "off",
95
+ },
96
+ },
97
+ {
98
+ files: ["**/*.test.ts", "**/*.test.tsx", "**/*.stories.*"],
99
+ rules: {
100
+ "@typescript-eslint/typedef": ["off"],
101
+ "@typescript-eslint/explicit-function-return-type": ["off"],
102
+ },
103
+ }
104
+ ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-config-gits",
3
- "version": "5.0.1",
3
+ "version": "5.0.2",
4
4
  "description": "EsLint preset for Geenen IT-Systeme",
5
5
  "repository": "https://gitlab.com/geenen-it-systeme/eslint-preset",
6
6
  "main": "index.js",
@@ -14,15 +14,21 @@
14
14
  "author": "",
15
15
  "license": "ISC",
16
16
  "peerDependencies": {
17
+ "@typescript-eslint/eslint-plugin": "^8",
18
+ "@eslint/eslintrc": "^3",
19
+ "@eslint/js": "^9",
17
20
  "eslint": "^9",
18
21
  "eslint-plugin-prettier": "^5",
19
22
  "eslint-plugin-react": "^7",
20
23
  "eslint-plugin-react-hooks": "^5.1.0-rc-1d989965-20240821",
21
24
  "eslint-plugin-storybook": "^0",
22
- "prettier": "^3",
23
- "@typescript-eslint/eslint-plugin": "^8"
25
+ "globals": "^15",
26
+ "prettier": "^3"
24
27
  },
25
28
  "devDependencies": {
29
+ "@eslint/compat": "^1.1.1",
30
+ "@eslint/eslintrc": "^3.1.0",
31
+ "@eslint/js": "^9.9.0",
26
32
  "@semantic-release/changelog": "^6.0.3",
27
33
  "@semantic-release/git": "^10.0.1",
28
34
  "@semantic-release/gitlab": "^13.2.1",
package/index.js DELETED
@@ -1,86 +0,0 @@
1
- module.exports = {
2
- plugins: ['react', '@typescript-eslint', 'prettier', 'react-hooks'],
3
- extends: [
4
- 'eslint:recommended',
5
- 'plugin:react/recommended',
6
- 'plugin:@typescript-eslint/recommended',
7
- 'plugin:react-hooks/recommended',
8
- ],
9
- parser: '@typescript-eslint/parser',
10
- parserOptions: {
11
- ecmaFeatures: {
12
- jsx: true,
13
- },
14
- ecmaVersion: 'latest',
15
- sourceType: 'module',
16
- },
17
- rules: {
18
- 'no-undefined': 'error',
19
- 'prettier/prettier': [
20
- 'error',
21
- {
22
- tabWidth: 4,
23
- useTabs: false,
24
- printWidth: 80,
25
- semi: true,
26
- singleQuote: true,
27
- quoteProps: 'as-needed',
28
- jsxSingleQuote: false,
29
- trailingComma: 'es5',
30
- bracketSpacing: true,
31
- bracketSameLine: false,
32
- arrowParens: 'avoid',
33
- },
34
- ],
35
- '@typescript-eslint/explicit-function-return-type': 'off',
36
- '@typescript-eslint/no-inferrable-types': 'off',
37
- '@typescript-eslint/typedef': [
38
- 'error',
39
- {
40
- arrayDestructuring: false,
41
- arrowParameter: false,
42
- memberVariableDeclaration: true,
43
- objectDestructuring: false,
44
- parameter: false,
45
- propertyDeclaration: true,
46
- variableDeclaration: true,
47
- variableDeclarationIgnoreFunction: false,
48
- },
49
- ],
50
- '@typescript-eslint/no-unused-vars': 'error',
51
- 'default-param-last': ['error']
52
- },
53
- overrides: [
54
- {
55
- files: ['*.ts', '*.tsx'],
56
- rules: {
57
- '@typescript-eslint/explicit-function-return-type': ['error'],
58
- 'react/jsx-curly-brace-presence': ['error', {props: "never", children: "never"}],
59
- 'arrow-body-style': ['error', 'as-needed']
60
- },
61
- },
62
- {
63
- files: ['*.json'],
64
- rules: {
65
- 'prettier/prettier': 'off',
66
- },
67
- },
68
- {
69
- files: ['**/*.stories.*'],
70
- rules: {
71
- 'import/no-anonymous-default-export': 'off',
72
- },
73
- },
74
- {
75
- files: ['*.test.ts', '*.test.tsx', '*.stories.*'],
76
- rules: {
77
- '@typescript-eslint/typedef': [
78
- 'off'
79
- ],
80
- '@typescript-eslint/explicit-function-return-type': [
81
- 'off'
82
- ],
83
- }
84
- }
85
- ],
86
- };