@hayuno/eslint-config 1.0.6 → 1.0.8
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/README.md +9 -9
- package/index.mjs +2 -2
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
# @hayuno
|
|
1
|
+
# @hayuno/eslint-config
|
|
2
2
|
|
|
3
3
|
This packages offers configurations for ESLint and Prettier which are used for projects at Hayuno AG.
|
|
4
4
|
|
|
5
5
|
## Prerequisites
|
|
6
6
|
|
|
7
|
-
Install `eslint`, `typescript`, `@typescript-eslint/parser`, `eslint-config-prettier`, `prettier` and `@hayuno
|
|
7
|
+
Install `eslint`, `typescript`, `@typescript-eslint/parser`, `eslint-config-prettier`, `prettier` and `@hayuno/eslint-config` as dev dependencies:
|
|
8
8
|
|
|
9
9
|
```sh
|
|
10
|
-
npm install --save-dev @hayuno
|
|
10
|
+
npm install --save-dev @hayuno/eslint-config eslint typescript @typescript-eslint/parser eslint-config-prettier prettier
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
Note: If you're using Next.js, `next` is already expected to be installed in your project. The plugin is included as a dependency of this package: `@next/eslint-plugin-next`.
|
|
@@ -18,7 +18,7 @@ By setting-up your `eslint.config.mjs` (example):
|
|
|
18
18
|
|
|
19
19
|
```js
|
|
20
20
|
import { defineConfig } from 'eslint/config';
|
|
21
|
-
import eslintConfig from '@hayuno
|
|
21
|
+
import eslintConfig from '@hayuno/eslint-config';
|
|
22
22
|
// additional imports
|
|
23
23
|
|
|
24
24
|
export default defineConfig([
|
|
@@ -36,7 +36,7 @@ export default defineConfig([
|
|
|
36
36
|
{
|
|
37
37
|
files: ['tests/**/*.test.tsx', 'tests/**/*.test.ts'],
|
|
38
38
|
rules: {
|
|
39
|
-
'@hayuno
|
|
39
|
+
'@hayuno/no-speculative-it': 'warn',
|
|
40
40
|
/* your additional rule overrides */
|
|
41
41
|
},
|
|
42
42
|
},
|
|
@@ -53,7 +53,7 @@ export default defineConfig([
|
|
|
53
53
|
|
|
54
54
|
This package also offers a custom rules plugin, which can be used to add custom rules to your project.
|
|
55
55
|
|
|
56
|
-
Currently, there's only one rule: `@hayuno
|
|
56
|
+
Currently, there's only one rule: `@hayuno/no-speculative-it`, defined at `rules/no-speculative-it.ts`.
|
|
57
57
|
|
|
58
58
|
### Defining additional rules
|
|
59
59
|
|
|
@@ -69,10 +69,10 @@ As shown in [Integration](#integration) above, you can change a rule's severity
|
|
|
69
69
|
property of your `eslint.config.mjs`. If you don't want to override a rule's severity level, you don't have
|
|
70
70
|
to add it to the according `rules` property. It then is executed with its default severity level.
|
|
71
71
|
|
|
72
|
-
The names of the rules defined in this project are prefixed with `@hayuno
|
|
73
|
-
is referenced by `@hayuno
|
|
72
|
+
The names of the rules defined in this project are prefixed with `@hayuno/`. Therefore, `no-speculative-it`
|
|
73
|
+
is referenced by `@hayuno/no-speculative-it`.
|
|
74
74
|
|
|
75
|
-
### `@hayuno
|
|
75
|
+
### `@hayuno/no-speculative-it`
|
|
76
76
|
|
|
77
77
|
This rule is used to prevent speculative `it` statements and enforces the usage of imperative statements instead.
|
|
78
78
|
|
package/index.mjs
CHANGED
|
@@ -62,10 +62,10 @@ const globalPlugins = [
|
|
|
62
62
|
const customPlugin = require('./rules/custom');
|
|
63
63
|
const customRules = {
|
|
64
64
|
plugins: {
|
|
65
|
-
'@hayuno
|
|
65
|
+
'@hayuno': customPlugin,
|
|
66
66
|
},
|
|
67
67
|
rules: Object.fromEntries(
|
|
68
|
-
Object.entries(customPlugin.rules).map(([name, rule]) => [`@hayuno
|
|
68
|
+
Object.entries(customPlugin.rules).map(([name, rule]) => [`@hayuno/${name}`, rule.meta?.severity || 'error']),
|
|
69
69
|
),
|
|
70
70
|
};
|
|
71
71
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hayuno/eslint-config",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.8",
|
|
4
4
|
"description": "ESLint configuration used for projects at Hayuno AG",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"typescript",
|
|
12
12
|
"prettier"
|
|
13
13
|
],
|
|
14
|
-
"homepage": "https://gitlab.com/hayuno/eslint-config#
|
|
14
|
+
"homepage": "https://gitlab.com/hayuno/eslint-config#hayunoeslint-config",
|
|
15
15
|
"bugs": {
|
|
16
16
|
"url": "https://gitlab.com/hayuno/eslint-config/issues"
|
|
17
17
|
},
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"prepare": "husky"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@next/eslint-plugin-next": ">=
|
|
37
|
+
"@next/eslint-plugin-next": ">=16.0.0",
|
|
38
38
|
"@typescript-eslint/eslint-plugin": "^8.37.0",
|
|
39
39
|
"eslint-plugin-import": "^2.32.0",
|
|
40
40
|
"eslint-plugin-jest": "^29.0.1",
|