@soleil-se/eslint-config 4.0.0 → 5.0.0
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 +8 -0
- package/LICENSE.md +1 -1
- package/README.md +20 -11
- package/index.js +40 -9
- package/package.json +6 -6
- package/utils/hasDependency.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,14 @@ Alla förändringar i detta repository antecknas här.
|
|
|
5
5
|
Formatet baseras på [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
och projektet använder [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [5.0.0] - 2023-05-26
|
|
9
|
+
|
|
10
|
+
- Nytt plugin för linting av Svelte.
|
|
11
|
+
|
|
12
|
+
## [4.0.1] - 2023-03-27
|
|
13
|
+
|
|
14
|
+
- Läs bara in overrides för Svelte-filer när Svelte är installerat i projektet.
|
|
15
|
+
|
|
8
16
|
## [4.0.0] - 2022-06-22
|
|
9
17
|
|
|
10
18
|
- Förenkla genom att ta bort de de olika konfigurationerna och använd en och samma config för allt utom legacy kod.
|
package/LICENSE.md
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(c) Copyright
|
|
1
|
+
(c) Copyright 2023 Soleil AB, all rights reserved.
|
package/README.md
CHANGED
|
@@ -18,30 +18,39 @@ Om man stöter på ett fel man inte förstår kan man kolla i styleguiden eller
|
|
|
18
18
|
|
|
19
19
|
Installera konfigurationen, ESLint och de plugins som behövs plugins i ditt projekt genom att köra:
|
|
20
20
|
|
|
21
|
-
```
|
|
22
|
-
|
|
21
|
+
```sh
|
|
22
|
+
> npm install @soleil-se/eslint-config-sitevision eslint eslint-config-airbnb-base eslint-plugin-import --save-dev
|
|
23
|
+
> yarn add @soleil-se/eslint-config-sitevision eslint eslint-config-airbnb-base eslint-plugin-import --dev
|
|
23
24
|
```
|
|
24
25
|
|
|
25
26
|
Om Svelte används i projektet:
|
|
26
27
|
|
|
27
|
-
```
|
|
28
|
-
|
|
28
|
+
```sh
|
|
29
|
+
> npm install eslint-plugin-svelte svelte svelte-preprocess eslint-config-prettier --save-dev
|
|
30
|
+
> yarn add eslint-plugin-svelte svelte svelte-preprocess eslint-config-prettier --dev
|
|
29
31
|
```
|
|
30
32
|
|
|
31
33
|
## Uppgradera
|
|
32
34
|
|
|
35
|
+
### Version 4.x.x > 5.x.x
|
|
36
|
+
|
|
37
|
+
- Uppgradera `@soleil-se/eslint-config-sitevision` till version 5.
|
|
38
|
+
- Avinstallera `eslint-plugin-svelte3`.
|
|
39
|
+
- Installera `eslint-plugin-svelte`.
|
|
40
|
+
- Installera `eslint-config-prettier` om det inte redan är installerat.
|
|
41
|
+
|
|
33
42
|
### Version 3.x.x > 4.x.x
|
|
34
43
|
|
|
35
44
|
- Om Vue används i projektet **stanna** på version 3, stödet för Vue plockas bort i denna version.
|
|
36
|
-
- Uppgradera `@soleil-se/eslint-config-sitevision` till version 4
|
|
37
|
-
- Om Svelte används i projektet installera `eslint-config-prettier
|
|
45
|
+
- Uppgradera `@soleil-se/eslint-config-sitevision` till version 4.
|
|
46
|
+
- Om Svelte används i projektet installera `eslint-config-prettier`.
|
|
38
47
|
- Byt ut alla importer av konfigurationer:
|
|
39
48
|
- `@soleil-se/eslint-config-sitevision/global` > `@soleil-se/eslint-config-sitevision`
|
|
40
49
|
- `@soleil-se/eslint-config-sitevision/webapp` > `@soleil-se/eslint-config-sitevision`
|
|
41
50
|
- `@soleil-se/eslint-config-sitevision/client` > `@soleil-se/eslint-config-sitevision`
|
|
42
51
|
- `@soleil-se/eslint-config-sitevision/server-es6` > `@soleil-se/eslint-config-sitevision`
|
|
43
52
|
- `@soleil-se/eslint-config-sitevision/universal` > `@soleil-se/eslint-config-sitevision`
|
|
44
|
-
- Byt ut alla importer av legacy
|
|
53
|
+
- Byt ut alla importer av legacy-konfigurationer:
|
|
45
54
|
- `@soleil-se/eslint-config-sitevision/server-legacy` > `@soleil-se/eslint-config-sitevision/legacy`
|
|
46
55
|
- `@soleil-se/eslint-config-sitevision/server` > `@soleil-se/eslint-config-sitevision/legacy`
|
|
47
56
|
|
|
@@ -52,7 +61,7 @@ yarn add eslint-plugin-svelte3@^3.0.0 svelte@^3.0.0 svelte-preprocess@^4.0.0 esl
|
|
|
52
61
|
- Uppgradera `eslint-config-airbnb-base` till version 15.
|
|
53
62
|
- Ändra importer till Sitevisions API:er till `@sitevision/api/(server|common|client)/NamnPåAPI`.
|
|
54
63
|
|
|
55
|
-
###
|
|
64
|
+
### Version 1.x.x > 2.x.x
|
|
56
65
|
|
|
57
66
|
- Uppgradera `eslint` till version 7.
|
|
58
67
|
- Installera alla dependencies enligt installationssteget.
|
|
@@ -60,7 +69,7 @@ yarn add eslint-plugin-svelte3@^3.0.0 svelte@^3.0.0 svelte-preprocess@^4.0.0 esl
|
|
|
60
69
|
|
|
61
70
|
## Config
|
|
62
71
|
|
|
63
|
-
ESLint
|
|
72
|
+
ESLint läser främst från `.eslintrc.js` filer i projektet.
|
|
64
73
|
<https://eslint.org/docs/user-guide/configuring#using-configuration-files-1>
|
|
65
74
|
|
|
66
75
|
### Importera config
|
|
@@ -138,8 +147,8 @@ Man kan ställa in så enklare fel åtgärdas automatiskt under [settings](https
|
|
|
138
147
|
|
|
139
148
|
#### Max length
|
|
140
149
|
|
|
141
|
-
Airbnb
|
|
142
|
-
Man kan ställa så man visar en linje i Visual Studio Code för att visualisera detta. Görs i [settings](https://code.visualstudio.com/docs/getstarted/settings).
|
|
150
|
+
Airbnb förespråkar en maxlängd på 100 tecken på en rad.
|
|
151
|
+
Man kan ställa in så man visar en linje i Visual Studio Code för att visualisera detta. Görs i [settings](https://code.visualstudio.com/docs/getstarted/settings).
|
|
143
152
|
|
|
144
153
|
```json
|
|
145
154
|
{
|
package/index.js
CHANGED
|
@@ -2,7 +2,6 @@ const { hasSvelte, hasPrettier } = require('./utils/hasDependency');
|
|
|
2
2
|
|
|
3
3
|
module.exports = {
|
|
4
4
|
extends: ['airbnb-base'],
|
|
5
|
-
plugins: hasSvelte ? ['svelte3'] : [],
|
|
6
5
|
parserOptions: {
|
|
7
6
|
ecmaVersion: 'latest',
|
|
8
7
|
sourceType: 'module',
|
|
@@ -33,23 +32,55 @@ module.exports = {
|
|
|
33
32
|
}],
|
|
34
33
|
'no-console': [1, { allow: ['error'] }],
|
|
35
34
|
},
|
|
36
|
-
overrides: [{
|
|
35
|
+
overrides: hasSvelte ? [{
|
|
37
36
|
files: ['*.svelte'],
|
|
38
|
-
extends:
|
|
39
|
-
|
|
37
|
+
extends: ['plugin:svelte/recommended', 'plugin:svelte/prettier']
|
|
38
|
+
.concat(hasPrettier ? ['prettier'] : []),
|
|
40
39
|
rules: {
|
|
41
|
-
|
|
40
|
+
// Turn off rules not applicable for Svelte
|
|
42
41
|
'import/no-mutable-exports': 0,
|
|
43
|
-
'import/
|
|
42
|
+
'import/no-named-as-default': 0,
|
|
43
|
+
'import/no-named-as-default-member': 0,
|
|
44
|
+
'import/named': 0,
|
|
45
|
+
'import/namespace': 0,
|
|
46
|
+
'import/default': 0,
|
|
47
|
+
'import/no-cycle': 0,
|
|
48
|
+
'import/no-unused-modules': 0,
|
|
49
|
+
'import/no-deprecated': 0,
|
|
44
50
|
'no-multiple-empty-lines': 0,
|
|
45
51
|
'no-label-var': 0,
|
|
46
52
|
'no-undef-init': 0,
|
|
47
53
|
'no-return-assign': 0,
|
|
48
54
|
'operator-linebreak': 'off',
|
|
49
55
|
'object-curly-newline': 'off',
|
|
56
|
+
// Security Vulnerability
|
|
57
|
+
'svelte/no-at-html-tags': 'warn',
|
|
58
|
+
// Possible Errors
|
|
59
|
+
'svelte/infinite-reactive-loop': 'error',
|
|
60
|
+
'svelte/no-dupe-else-if-blocks': 'error',
|
|
61
|
+
'svelte/no-dupe-on-directives': 'error',
|
|
62
|
+
'svelte/no-reactive-reassign': 'error',
|
|
63
|
+
'svelte/no-store-async': 'error',
|
|
64
|
+
'svelte/require-store-reactive-access': 'error',
|
|
65
|
+
'svelte/valid-compile': 0,
|
|
66
|
+
// Best Practices
|
|
67
|
+
'svelte/no-at-debug-tags': 'warn',
|
|
68
|
+
'svelte/no-immutable-reactive-statements': 'warn',
|
|
69
|
+
'svelte/no-reactive-functions': 'warn',
|
|
70
|
+
'svelte/no-reactive-literals': 'warn',
|
|
71
|
+
'svelte/no-useless-mustaches': 'warn',
|
|
72
|
+
// Stylistic
|
|
73
|
+
'svelte/no-extra-reactive-curlies': 'warn',
|
|
74
|
+
'svelte/prefer-style-directive': 'warn',
|
|
75
|
+
'svelte/sort-attributes': 'warn',
|
|
76
|
+
'svelte/spaced-html-comment': 'warn',
|
|
77
|
+
// Extension Rules
|
|
78
|
+
'svelte/no-trailing-spaces': 'error',
|
|
50
79
|
},
|
|
51
|
-
|
|
52
|
-
|
|
80
|
+
}, {
|
|
81
|
+
files: ['svelte.config.js'],
|
|
82
|
+
rules: {
|
|
83
|
+
'import/no-extraneous-dependencies': 0,
|
|
53
84
|
},
|
|
54
|
-
}],
|
|
85
|
+
}] : [],
|
|
55
86
|
};
|
package/package.json
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@soleil-se/eslint-config",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"description": "ESLint konfiguration för Sitevision utveckling",
|
|
5
5
|
"author": "Soleil AB",
|
|
6
6
|
"license": "UNLICENSED",
|
|
7
7
|
"private": false,
|
|
8
8
|
"homepage": "https://docs.soleilit.se/03.packages/@soleil&@soleil-se/eslint-config",
|
|
9
9
|
"devDependencies": {
|
|
10
|
-
"eslint": "^8.
|
|
10
|
+
"eslint": "^8.40.0",
|
|
11
11
|
"eslint-config-airbnb-base": "^15.0.0",
|
|
12
|
-
"eslint-
|
|
13
|
-
"eslint-plugin-
|
|
14
|
-
"eslint-
|
|
15
|
-
"svelte": "^3.
|
|
12
|
+
"eslint-plugin-import": "^2.27.5",
|
|
13
|
+
"eslint-plugin-svelte": "^2.28.0",
|
|
14
|
+
"eslint-config-prettier": "^8.8.0",
|
|
15
|
+
"svelte": "^3.59.1"
|
|
16
16
|
},
|
|
17
17
|
"peerDependencies": {
|
|
18
18
|
"eslint": "^8.0.0",
|
package/utils/hasDependency.js
CHANGED