eslint-config-gits 5.0.5 → 5.0.7

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,17 @@
1
+ ## [5.0.7](https://gitlab.com/geenen-it-systeme/eslint-preset/compare/v5.0.6...v5.0.7) (2024-08-22)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * Configure globals ([e021395](https://gitlab.com/geenen-it-systeme/eslint-preset/commit/e021395a6ea4eeffe25740740351db5ec7f29de8))
7
+
8
+ ## [5.0.6](https://gitlab.com/geenen-it-systeme/eslint-preset/compare/v5.0.5...v5.0.6) (2024-08-22)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * Migrate to correct eslint 9 flat config ([8135692](https://gitlab.com/geenen-it-systeme/eslint-preset/commit/8135692794d0ee4f0b6967e113ccde136e0646d8))
14
+
1
15
  ## [5.0.5](https://gitlab.com/geenen-it-systeme/eslint-preset/compare/v5.0.4...v5.0.5) (2024-08-22)
2
16
 
3
17
 
package/README.md CHANGED
@@ -8,34 +8,17 @@ This ESLint-Config provides commonly used configuration for eslint for all our p
8
8
  ## Installation
9
9
 
10
10
  ```shell
11
- npm install --save-dev eslint eslint-config-gits globals @eslint/js @eslint/eslintr
11
+ npm install --save-dev eslint eslint-config-gits
12
12
  ```
13
13
 
14
14
  ## Example configuration
15
15
 
16
16
  ```js
17
17
  // eslint.config.mjs
18
- import globals from "globals";
19
- import path from "node:path";
20
- import {fileURLToPath} from "node:url";
21
- import js from "@eslint/js";
22
- import {FlatCompat} from "@eslint/eslintrc";
23
-
24
- const __filename = fileURLToPath(import.meta.url);
25
- const __dirname = path.dirname(__filename);
26
- const compat = new FlatCompat({
27
- baseDirectory: __dirname,
28
- recommendedConfig: js.configs.recommended,
29
- allConfig: js.configs.all
30
- });
31
-
32
- export default [...compat.extends("eslint-config-gits"), {
33
- languageOptions: {
34
- globals: {
35
- ...globals.browser,
36
- ...globals.jest,
37
- ...globals.node,
38
- },
39
- },
40
- }];
18
+ import gitsConfig from 'eslint-config-gits';
19
+
20
+ export default [
21
+ ...gitsConfig,
22
+ ];
23
+
41
24
  ```
package/index.mjs CHANGED
@@ -8,6 +8,8 @@ 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';
12
+ import globals from 'globals';
11
13
 
12
14
  const __filename = fileURLToPath(import.meta.url);
13
15
  const __dirname = path.dirname(__filename);
@@ -17,88 +19,94 @@ const compat = new FlatCompat({
17
19
  allConfig: js.configs.all
18
20
  });
19
21
 
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,
22
+ const plugin = {
23
+ meta: {
24
+ name,
25
+ version
26
+ },
27
+ configs: {
28
+ recommended: [
29
+ ...fixupConfigRules(compat.extends(
30
+ "eslint:recommended",
31
+ "plugin:react/recommended",
32
+ "plugin:@typescript-eslint/recommended",
33
+ "plugin:react-hooks/recommended",
34
+ )),
35
+ {
36
+ plugins: {
37
+ react: fixupPluginRules(react),
38
+ "@typescript-eslint": fixupPluginRules(typescriptEslint),
39
+ prettier,
40
+ "react-hooks": fixupPluginRules(reactHooks),
41
+ },
42
+ languageOptions: {
43
+ globals: {
44
+ ...globals.browser,
45
+ ...globals.jest,
46
+ ...globals.node,
47
+ },
48
+ parser: tsParser,
49
+ ecmaVersion: "latest",
50
+ sourceType: "module",
51
+ parserOptions: {
52
+ ecmaFeatures: {
53
+ jsx: true,
54
+ },
55
+ },
56
+ },
57
+ },
58
+ {
59
+ files: ['*.ts', '*.tsx'],
60
+ rules: {
61
+ '@typescript-eslint/explicit-function-return-type': ['error'],
62
+ 'react/jsx-curly-brace-presence': ['error', {props: "never", children: "never"}],
63
+ 'arrow-body-style': ['error', 'as-needed']
64
+ },
65
+ },
66
+ {
67
+ files: ['*.json'],
68
+ rules: {
69
+ 'prettier/prettier': 'off',
41
70
  },
42
71
  },
43
- },
44
- rules: {
45
- "no-undefined": "error",
46
- "prettier/prettier": ["error", {
72
+ {
73
+ files: ['**/*.stories.*'],
74
+ rules: {
75
+ 'import/no-anonymous-default-export': 'off',
76
+ },
77
+ },
78
+ {
79
+ files: ['*.test.ts', '*.test.tsx', '*.stories.*'],
80
+ rules: {
81
+ '@typescript-eslint/typedef': [
82
+ 'off'
83
+ ],
84
+ '@typescript-eslint/explicit-function-return-type': [
85
+ 'off'
86
+ ],
87
+ }
88
+ }
89
+ ]
90
+ },
91
+ rules: {
92
+ 'no-undefined': 'error',
93
+ 'prettier/prettier': [
94
+ 'error',
95
+ {
47
96
  tabWidth: 4,
48
97
  useTabs: false,
49
98
  printWidth: 80,
50
99
  semi: true,
51
100
  singleQuote: true,
52
- quoteProps: "as-needed",
101
+ quoteProps: 'as-needed',
53
102
  jsxSingleQuote: false,
54
- trailingComma: "es5",
103
+ trailingComma: 'es5',
55
104
  bracketSpacing: true,
56
105
  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
- },
106
+ arrowParens: 'avoid',
107
+ },
108
+ ],
109
+ 'default-param-last': ['error']
96
110
  },
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
- ];
111
+ };
112
+ 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.7",
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",
@@ -36,6 +36,7 @@
36
36
  "eslint-plugin-react": "^7.35.0",
37
37
  "eslint-plugin-react-hooks": "^5.1.0-rc-1d989965-20240821",
38
38
  "eslint-plugin-storybook": "^0.8.0",
39
+ "globals": "^15.9.0",
39
40
  "prettier": "^3.3.3",
40
41
  "semantic-release": "^24.1.0"
41
42
  }