eslint-config-gits 5.0.5 → 5.0.6

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.
Files changed (3) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/index.mjs +70 -48
  3. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [5.0.6](https://gitlab.com/geenen-it-systeme/eslint-preset/compare/v5.0.5...v5.0.6) (2024-08-22)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * Migrate to correct eslint 9 flat config ([8135692](https://gitlab.com/geenen-it-systeme/eslint-preset/commit/8135692794d0ee4f0b6967e113ccde136e0646d8))
7
+
1
8
  ## [5.0.5](https://gitlab.com/geenen-it-systeme/eslint-preset/compare/v5.0.4...v5.0.5) (2024-08-22)
2
9
 
3
10
 
package/index.mjs CHANGED
@@ -8,6 +8,7 @@ import path from "node:path";
8
8
  import {fileURLToPath} from "node:url";
9
9
  import js from "@eslint/js";
10
10
  import {FlatCompat} from "@eslint/eslintrc";
11
+ import {name, version} from './package.json';
11
12
 
12
13
  const __filename = fileURLToPath(import.meta.url);
13
14
  const __dirname = path.dirname(__filename);
@@ -17,7 +18,7 @@ const compat = new FlatCompat({
17
18
  allConfig: js.configs.all
18
19
  });
19
20
 
20
- export default [
21
+ const configs = [
21
22
  ...fixupConfigRules(compat.extends(
22
23
  "eslint:recommended",
23
24
  "plugin:react/recommended",
@@ -41,64 +42,85 @@ export default [
41
42
  },
42
43
  },
43
44
  },
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
45
  },
75
46
  {
76
- files: ["**/*.ts", "**/*.tsx"],
47
+ files: ['*.ts', '*.tsx'],
77
48
  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"],
49
+ '@typescript-eslint/explicit-function-return-type': ['error'],
50
+ 'react/jsx-curly-brace-presence': ['error', {props: "never", children: "never"}],
51
+ 'arrow-body-style': ['error', 'as-needed']
84
52
  },
85
53
  },
86
54
  {
87
- files: ["**/*.json"],
55
+ files: ['*.json'],
88
56
  rules: {
89
- "prettier/prettier": "off",
57
+ 'prettier/prettier': 'off',
90
58
  },
91
- }, {
92
- files: ["**/*.stories.*"],
59
+ },
60
+ {
61
+ files: ['**/*.stories.*'],
93
62
  rules: {
94
- "import/no-anonymous-default-export": "off",
63
+ 'import/no-anonymous-default-export': 'off',
95
64
  },
96
65
  },
97
66
  {
98
- files: ["**/*.test.ts", "**/*.test.tsx", "**/*.stories.*"],
67
+ files: ['*.test.ts', '*.test.tsx', '*.stories.*'],
99
68
  rules: {
100
- "@typescript-eslint/typedef": ["off"],
101
- "@typescript-eslint/explicit-function-return-type": ["off"],
102
- },
69
+ '@typescript-eslint/typedef': [
70
+ 'off'
71
+ ],
72
+ '@typescript-eslint/explicit-function-return-type': [
73
+ 'off'
74
+ ],
75
+ }
103
76
  }
104
- ];
77
+ ]
78
+
79
+ const rules = {
80
+ 'no-undefined': 'error',
81
+ 'prettier/prettier': [
82
+ 'error',
83
+ {
84
+ tabWidth: 4,
85
+ useTabs: false,
86
+ printWidth: 80,
87
+ semi: true,
88
+ singleQuote: true,
89
+ quoteProps: 'as-needed',
90
+ jsxSingleQuote: false,
91
+ trailingComma: 'es5',
92
+ bracketSpacing: true,
93
+ bracketSameLine: false,
94
+ arrowParens: 'avoid',
95
+ },
96
+ ],
97
+ '@typescript-eslint/explicit-function-return-type': 'off',
98
+ '@typescript-eslint/no-inferrable-types': 'off',
99
+ '@typescript-eslint/typedef': [
100
+ 'error',
101
+ {
102
+ arrayDestructuring: false,
103
+ arrowParameter: false,
104
+ memberVariableDeclaration: true,
105
+ objectDestructuring: false,
106
+ parameter: false,
107
+ propertyDeclaration: true,
108
+ variableDeclaration: true,
109
+ variableDeclarationIgnoreFunction: false,
110
+ },
111
+ ],
112
+ '@typescript-eslint/no-unused-vars': 'error',
113
+ 'default-param-last': ['error']
114
+ };
115
+
116
+ const plugin = {
117
+ meta: {
118
+ name,
119
+ version
120
+ },
121
+ configs: {
122
+ recommended: configs
123
+ },
124
+ rules,
125
+ };
126
+ export default plugin;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-config-gits",
3
- "version": "5.0.5",
3
+ "version": "5.0.6",
4
4
  "description": "EsLint preset for Geenen IT-Systeme",
5
5
  "repository": "https://gitlab.com/geenen-it-systeme/eslint-preset",
6
6
  "main": "index.mjs",