@soleil-se/eslint-config 2.2.0 → 2.3.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 CHANGED
@@ -4,6 +4,23 @@ Alla förändringar i detta repository antecknas här.
4
4
  Formatet baseras på [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5
5
  och projektet använder [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [2.3.0] - 2021-02-16
8
+ ### Ändrat
9
+ - Fler regler överlappar när man skriver universell kod.
10
+ - Slagit av `import/prefer-default-export`.
11
+ - Slagit av `no-return-assig` i Svelte komponenter.
12
+ - Tagit bort linting av skript i HTML för server konfigurationen för ES5-kod.
13
+
14
+ ## [2.2.1] - 2021-01-07
15
+ ### Fixat
16
+ - Tagit bort `babel-eslint` från dependencies.
17
+
18
+ ## [2.2.0] - 2021-01-07
19
+ ### Ändrat
20
+ - Tagit bort `babel-eslint` och använder standardparsern med ES2020.
21
+ - Förenklat `svelte.config.js`, oftast behövs inte plugin för globbing.
22
+ - Lagt till paketet `cache` som undantag för SiteVision paket.
23
+
7
24
  ## [2.1.4] - 2020-10-26
8
25
  ### Fixat
9
26
  - Tagit bort felaktig konfiguration av `a11y-no-onchange`.
package/README.md CHANGED
@@ -43,11 +43,6 @@ https://eslint.org/docs/rules/
43
43
  - [7.1 Kodformatering](#71-kodformatering)
44
44
  - [7.2 Preprocessing](#72-preprocessing)
45
45
  - [8. Git](#8-git)
46
- - [9. Undantag](#9-undantag)
47
- - [9.1. Server - ES2015+](#91-server---es2015)
48
- - [9.2. Client](#92-client)
49
- - [9.3. Server - ES5](#93-server---es5)
50
- - [9.3.1. Velocity](#931-velocity)
51
46
 
52
47
  <!-- /TOC -->
53
48
 
@@ -58,7 +53,7 @@ Installera konfigurationen, `eslint` och de plugins som behövs plugins i ditt p
58
53
 
59
54
  ### Ramverk
60
55
  Om Vue används i projektet:
61
- `yarn add eslint-plugin-vue@6.2.2 --dev`
56
+ `yarn add eslint-plugin-vue@6.2.2 vue-eslint-parser --dev`
62
57
 
63
58
  Om Svelte använs i projektet:
64
59
  `yarn add eslint-plugin-svelte3 svelte svelte-preprocess --dev`
@@ -460,26 +455,3 @@ Om man har problem med linebreaks i git kan man behöva göra följande:
460
455
  Mer info:
461
456
  https://stackoverflow.com/questions/9976986/force-lf-eol-in-git-repo-and-working-copy/34810209#34810209
462
457
 
463
- ## 9. Undantag
464
-
465
- ### 9.1. Server - ES2015+
466
- `import/no-unresolved` - För att kunna importera SiteVisions API:er utan fel.
467
- `func-names` - Borde inte vara en varning, Airbnb tillåter anonyma funktioner.
468
- `import/extensions` - `ignorePackages` är satt till `true` så import via alias ska fungera.
469
-
470
- ### 9.2. Client
471
- `no-param-reassign` - Undantag för `state` i Vuex [mutations](https://vuex.vuejs.org/en/mutations.html).
472
- `vue/max-attributes-per-line` - Undantag för `allowFirstLine`, blev svårläst när det enforcas på element med korta namn (`<p> <a>` osv...)
473
- `vue/component-name-in-template-casing` - Enforca PascalCase i Vue komponenter.
474
-
475
- ### 9.3. Server - ES5
476
- `no-unused-vars` - Se till att visa vilka variabler som används i Velocity med `/* exported var1 var2 */` i toppen av filen.
477
- `no-undef` - Om en variabel är global, definera det med `/* global var1 var2 */` i toppen av filen.
478
- `vars-on-top` - Avslaget, blir helt crazy annars - Linh.
479
- `no-param-reassign` - Undantag för `data` i våra dataCreators, vi använder oss av accumilator pattern.
480
- `func-names` - Borde inte vara en varning, Airbnb tillåter anonyma funktioner.
481
- `import/no-unresolved` - För att kunna importera SiteVisions API:er utan fel.
482
- `global-require` - För att kunna skriva `require` innanför IIFE i `src/index.js` i en Webapp.
483
-
484
- #### 9.3.1. Velocity
485
- `no-template-curly-in-string` - Avslaget, Velocity variabler ser ut som template variabler i ES6.
package/global.js CHANGED
@@ -7,7 +7,7 @@ module.exports = {
7
7
  extends: getExtends(),
8
8
  plugins: getPlugins(),
9
9
  parserOptions: {
10
- ecmaVersion: 2020,
10
+ ecmaVersion: 2021,
11
11
  sourceType: 'module',
12
12
  },
13
13
  overrides: [
@@ -16,14 +16,9 @@ module.exports = {
16
16
  '*.vue',
17
17
  '*.svelte',
18
18
  'client_src/js/**/*.js',
19
- 'server_src/webapps/**/app_src/main.js',
20
- 'server_src/webapps/**/app_src/client/**/*.js',
21
- 'server_src/webapps/**/app_src/config/config.js',
22
- 'server_src/webapps/**/app_src/config/client/**/*.js',
23
- 'server_src/webapps/**/app_config/config.js',
24
- 'server_src/webapps/**/app_config/client/**/*.js',
25
- 'server_src/webapps/**/app_config_global/config.js',
26
- 'server_src/webapps/**/app_config_global/client/**/*.js',
19
+ 'server_src/webapps/**/app_src/**/*.js',
20
+ 'server_src/webapps/**/app_config/**/*.js',
21
+ 'server_src/webapps/**/app_config_global/**/*.js',
27
22
  ],
28
23
  ...client,
29
24
  },
@@ -34,16 +29,9 @@ module.exports = {
34
29
  'server_src/scripts/**/*.js',
35
30
  'server_src/restapps/**/*.js',
36
31
  'server_src/webapps/api/**/*.js',
37
- 'server_src/webapps/**/app_src/index.js',
38
- 'server_src/webapps/**/app_src/hooks.js',
39
- 'server_src/webapps/**/app_src/server/**/*.js',
40
- 'server_src/webapps/**/app_src/views/**/*.js',
41
- 'server_src/webapps/**/app_src/config/index.js',
42
- 'server_src/webapps/**/app_src/config/server/**/*.js',
43
- 'server_src/webapps/**/app_config/index.js',
44
- 'server_src/webapps/**/app_config/server/**/*.js',
45
- 'server_src/webapps/**/app_config_global/index.js',
46
- 'server_src/webapps/**/app_config_global/server/**/*.js',
32
+ 'server_src/webapps/**/app_src/**/*.js',
33
+ 'server_src/webapps/**/app_config/**/*.js',
34
+ 'server_src/webapps/**/app_config_global/**/*.js',
47
35
  ],
48
36
  ...server,
49
37
  },
@@ -8,6 +8,7 @@ module.exports = {
8
8
  'no-multiple-empty-lines': 0,
9
9
  'no-label-var': 0,
10
10
  'no-undef-init': 0,
11
+ 'no-return-assig': 0,
11
12
  'operator-linebreak': 'off',
12
13
  'object-curly-newline': 'off',
13
14
  },
package/package.json CHANGED
@@ -1,28 +1,23 @@
1
1
  {
2
2
  "name": "@soleil-se/eslint-config",
3
- "version": "2.2.0",
3
+ "version": "2.3.0",
4
4
  "description": "Settings for ESLint in a SiteVision project",
5
5
  "author": "Soleil AB",
6
6
  "license": "UNLICENSED",
7
7
  "private": false,
8
8
  "homepage": "https://github.com/soleilit/@soleil-se/eslint-config#readme",
9
9
  "devDependencies": {
10
- "babel-eslint": "^10.1.0",
11
- "eslint": "^7.10.0",
12
- "eslint-config-airbnb-base": "^14.2.0",
10
+ "eslint": "^7.20.0",
11
+ "eslint-config-airbnb-base": "^14.2.1",
13
12
  "eslint-plugin-import": "^2.22.1",
14
- "eslint-plugin-svelte3": "^2.7.3",
13
+ "eslint-plugin-svelte3": "^3.1.1",
15
14
  "eslint-plugin-vue": "^6.2.2",
16
- "svelte": "^3.29.0"
15
+ "svelte": "^3.32.3"
17
16
  },
18
17
  "peerDependencies": {
19
- "babel-eslint": "^10.1.0",
20
- "eslint": "^7.10.0",
21
- "eslint-config-airbnb-base": "^14.2.0",
18
+ "eslint": "^7.20.0",
19
+ "eslint-config-airbnb-base": "^14.2.1",
22
20
  "eslint-plugin-import": "^2.22.1"
23
21
  },
24
- "scripts": {
25
- "publish-scope": "node ./publish"
26
- },
27
22
  "dependencies": {}
28
23
  }
package/server.js CHANGED
@@ -1,49 +1,29 @@
1
1
  module.exports = {
2
2
  extends: 'airbnb-base/legacy',
3
- overrides: [{
4
- files: ['*.js'],
5
- env: {
6
- amd: true,
7
- nashorn: true,
8
- node: false,
9
- commonjs: false,
10
- },
11
- globals: {
12
- scriptVariables: false,
13
- Packages: false,
14
- request: false,
15
- svimport: false,
16
- print: false,
17
- out: false,
18
- Api: true,
19
- solimport: true,
20
- },
21
- rules: {
22
- 'vars-on-top': 0,
23
- 'no-param-reassign': ['error', {
24
- props: true,
25
- ignorePropertyModificationsFor: ['data'],
26
- }],
27
- 'func-names': 0,
28
- 'global-require': 0,
29
- strict: 0,
30
- },
3
+ env: {
4
+ amd: true,
5
+ nashorn: true,
6
+ node: false,
7
+ commonjs: false,
31
8
  },
32
- {
33
- files: ['*.vm', '*.html'],
34
- env: {
35
- browser: true,
36
- jquery: true,
37
- },
38
- globals: {
39
- $svjq: false,
40
- Soleil: false,
41
- },
42
- rules: {
43
- 'vars-on-top': 0,
44
- 'no-template-curly-in-string': 0,
45
- 'func-names': 0,
46
- },
9
+ globals: {
10
+ scriptVariables: false,
11
+ Packages: false,
12
+ request: false,
13
+ svimport: false,
14
+ print: false,
15
+ out: false,
16
+ Api: true,
17
+ solimport: true,
18
+ },
19
+ rules: {
20
+ 'vars-on-top': 0,
21
+ 'no-param-reassign': ['error', {
22
+ props: true,
23
+ ignorePropertyModificationsFor: ['data'],
24
+ }],
25
+ 'func-names': 0,
26
+ 'global-require': 0,
27
+ strict: 0,
47
28
  },
48
- ],
49
29
  };
package/shared/client.js CHANGED
@@ -20,5 +20,6 @@ module.exports = {
20
20
  ignorePropertyModificationsFor: ['state'],
21
21
  }],
22
22
  'import/no-unresolved': [2, { ignore: ['#'] }],
23
+ 'import/prefer-default-export': 0,
23
24
  },
24
25
  };
package/shared/server.js CHANGED
@@ -44,5 +44,6 @@ module.exports = {
44
44
  svelte: 'always',
45
45
  },
46
46
  }],
47
+ 'import/prefer-default-export': 0,
47
48
  },
48
49
  };
package/universal.js CHANGED
@@ -15,30 +15,18 @@ module.exports = {
15
15
  files: [
16
16
  '*.vue',
17
17
  '*.svelte',
18
- 'app_src/main.js',
19
- 'app_src/client/**/*.js',
20
- 'app_src/config/config.js',
21
- 'config/client/**/*.js',
22
- 'app_config/config.js',
23
- 'app_config/client/**/*.js',
24
- 'app_config_global/config.js',
25
- 'app_config_global/client/**/*.js',
18
+ 'app_src/**/*.js',
19
+ 'app_config/**/*.js',
20
+ 'app_config_global/**/*.js',
26
21
  ],
27
22
  ...client,
28
23
  },
29
24
  {
30
25
  files: [
31
26
  '*.svelte',
32
- 'app_src/index.js',
33
- 'app_src/hooks.js',
34
- 'app_src/server/**/*.js',
35
- 'app_src/views/**/*.js',
36
- 'app_src/config/index.js',
37
- 'app_src/config/server/**/*.js',
38
- 'app_config/index.js',
39
- 'app_config/server/**/*.js',
40
- 'app_config_global/index.js',
41
- 'app_config_global/server/**/*.js',
27
+ 'app_src/**/*.js',
28
+ 'app_config/**/*.js',
29
+ 'app_config_global/**/*.js',
42
30
  ],
43
31
  ...server,
44
32
  },