@nice-move/eslint-config-base 0.5.67 → 0.5.71

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/lib/base.cjs CHANGED
@@ -13,15 +13,17 @@ module.exports = {
13
13
  env: {
14
14
  browser: true,
15
15
  es2021: true,
16
+ es2020: true,
17
+ es2017: true,
16
18
  commonjs: false,
17
19
  node: false,
18
20
  },
19
21
  plugins: ['eslint-comments'],
20
22
  extends: ['plugin:sonarjs/recommended'],
21
23
  rules: {
22
- 'sonarjs/cognitive-complexity': 'off',
23
- 'sonarjs/no-duplicate-string': 'off',
24
- 'sonarjs/no-identical-functions': 'off',
24
+ 'sonarjs/cognitive-complexity': 0,
25
+ 'sonarjs/no-duplicate-string': 0,
26
+ 'sonarjs/no-identical-functions': 0,
25
27
  'array-callback-return': [
26
28
  'error',
27
29
  {
@@ -29,18 +31,22 @@ module.exports = {
29
31
  checkForEach: true,
30
32
  },
31
33
  ],
32
- 'no-useless-rename': 'off',
33
- 'object-shorthand': 'off',
34
- 'arrow-body-style': 'off',
35
- camelcase: 'off',
34
+ 'no-useless-rename': 0,
35
+ 'object-shorthand': 0,
36
+ 'arrow-body-style': 0,
37
+ camelcase: 0,
36
38
  'class-methods-use-this': 'warn',
37
39
  'consistent-return': 'warn',
38
40
  'eslint-comments/no-unused-disable': 'warn',
39
41
  'eslint-comments/no-unused-enable': 'warn',
40
- 'global-require': 'off',
41
- 'lines-between-class-members': 'off',
42
- 'max-classes-per-file': 'off',
43
- 'no-console': 'off',
42
+ 'global-require': 0,
43
+ 'no-unreachable-loop': 0,
44
+ 'grouped-accessor-pairs': 0,
45
+ 'no-constructor-return': 0,
46
+ 'lines-between-class-members': 0,
47
+ 'max-classes-per-file': 0,
48
+ 'no-console': 0,
49
+ 'prefer-exponentiation-operator': 0,
44
50
  'no-empty': [
45
51
  'error',
46
52
  {
@@ -53,7 +59,7 @@ module.exports = {
53
59
  disallowTemplateShorthand: true,
54
60
  },
55
61
  ],
56
- 'no-nested-ternary': 'off',
62
+ 'no-nested-ternary': 0,
57
63
  'no-param-reassign': [
58
64
  'warn',
59
65
  { props: true, ignorePropertyModificationsFor: [] },
@@ -72,9 +78,9 @@ module.exports = {
72
78
  selector: 'LabeledStatement',
73
79
  },
74
80
  ],
75
- 'no-template-curly-in-string': 'off',
76
- 'no-undef-init': 'off',
77
- 'no-underscore-dangle': 'off',
81
+ 'no-template-curly-in-string': 0,
82
+ 'no-undef-init': 0,
83
+ 'no-underscore-dangle': 0,
78
84
  'no-unused-vars': [
79
85
  'error',
80
86
  {
@@ -85,7 +91,7 @@ module.exports = {
85
91
  ],
86
92
  'prefer-arrow-callback': 'warn',
87
93
  'prefer-template': 'warn',
88
- 'spaced-comment': 'off',
94
+ 'spaced-comment': 0,
89
95
  },
90
96
  overrides: [
91
97
  {
package/lib/import.cjs CHANGED
@@ -2,8 +2,6 @@
2
2
 
3
3
  const { join } = require('path');
4
4
 
5
- const { isReachable } = require('settingz');
6
-
7
5
  const { pkgHas, configHas } = require('./utils.cjs');
8
6
 
9
7
  const Vscode = pkgHas(
@@ -35,22 +33,15 @@ module.exports = {
35
33
  ],
36
34
  },
37
35
  ],
38
- 'import/newline-after-import': 'off',
39
- 'import/no-dynamic-require': 'off',
40
- 'import/order': 'off',
41
- 'import/prefer-default-export': 'off',
36
+ 'import/newline-after-import': 0,
37
+ 'import/no-dynamic-require': 0,
38
+ 'import/order': 0,
39
+ 'import/prefer-default-export': 0,
40
+ 'import/no-relative-packages': 0,
42
41
  },
43
42
  settings: {
44
43
  ...Vscode,
45
- 'import/extensions': [
46
- '.tsx',
47
- '.ts',
48
- ...(isReachable('vue-eslint-parser/package.json') ? ['.vue'] : []),
49
- '.jsx',
50
- '.js',
51
- '.mjs',
52
- '.cjs',
53
- ],
44
+ 'import/extensions': ['.tsx', '.ts', '.vue', '.jsx', '.js', '.mjs', '.cjs'],
54
45
  'import/parsers': {
55
46
  '@typescript-eslint/parser': ['.ts', '.tsx'],
56
47
  'vue-eslint-parser': ['.vue'],
package/lib/mini.cjs CHANGED
@@ -95,16 +95,28 @@ function generate({ miniprogramRoot, pluginRoot, cloudfunctionRoot }) {
95
95
  files: excludedFiles,
96
96
  env: {
97
97
  browser: false,
98
+ es2021: false,
99
+ es2020: false,
100
+ es2017: false,
101
+ es6: false,
102
+ },
103
+ parserOptions: {
104
+ ecmaVersion: 5,
105
+ sourceType: 'script',
98
106
  },
99
107
  globals: {
100
108
  require: 'readonly',
101
109
  module: 'readonly',
102
110
  },
103
111
  rules: {
104
- 'no-var': 'off',
112
+ 'import/no-commonjs': 0,
113
+ 'no-var': 0,
105
114
  'object-shorthand': ['error', 'never'],
106
- 'import/no-commonjs': 'off',
107
- 'unicorn/prefer-module': 'off',
115
+ 'prefer-spread': 0,
116
+ 'prefer-template': 0,
117
+ 'unicorn/prefer-includes': 0,
118
+ 'unicorn/prefer-export-from': 0,
119
+ 'unicorn/prefer-module': 0,
108
120
  },
109
121
  },
110
122
  ].filter(Boolean);
package/lib/node.cjs CHANGED
@@ -44,7 +44,7 @@ module.exports = {
44
44
  },
45
45
  settings: {
46
46
  node: {
47
- tryExtensions: ['.mjs', '.cjs', '.js'],
47
+ tryExtensions: ['.mjs', '.cjs', '.ts', '.js'],
48
48
  },
49
49
  },
50
50
  rules: {
@@ -66,11 +66,15 @@ module.exports = {
66
66
  strict: ['error', 'global'],
67
67
  'node/no-exports-assign': 'error',
68
68
  'node/no-new-require': 'error',
69
+ 'node/no-unsupported-features/es-syntax': [
70
+ 'error',
71
+ { ignores: ['dynamicImport'] },
72
+ ],
69
73
  },
70
74
  },
71
75
  {
72
- files: '*.{js,ts,jsx,tsx,vue,html,htm}',
73
- excludedFiles: ['**/*.md/*'],
76
+ files: '*.*',
77
+ excludedFiles: ['**/*.md/*', '*.cjs', '*.md'],
74
78
  rules: {
75
79
  'node/file-extension-in-import': 'error',
76
80
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nice-move/eslint-config-base",
3
- "version": "0.5.67",
3
+ "version": "0.5.71",
4
4
  "description": "A `eslint` config for best practice",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -34,19 +34,19 @@
34
34
  },
35
35
  "main": "index.cjs",
36
36
  "dependencies": {
37
- "@typescript-eslint/eslint-plugin": "^5.2.0",
38
- "@typescript-eslint/parser": "^5.2.0",
39
- "eslint-config-airbnb-base": "^14.2.1",
37
+ "@typescript-eslint/eslint-plugin": "^5.4.0",
38
+ "@typescript-eslint/parser": "^5.4.0",
39
+ "eslint-config-airbnb-base": "^15.0.0",
40
40
  "eslint-config-prettier": "^8.3.0",
41
41
  "eslint-plugin-eslint-comments": "^3.2.0",
42
42
  "eslint-plugin-html": "^6.2.0",
43
- "eslint-plugin-import": "^2.25.2",
43
+ "eslint-plugin-import": "^2.25.3",
44
44
  "eslint-plugin-markdown": "^2.2.1",
45
45
  "eslint-plugin-node": "^11.1.0",
46
46
  "eslint-plugin-promise": "^5.1.1",
47
47
  "eslint-plugin-sonarjs": "^0.10.0",
48
- "eslint-plugin-unicorn": "^37.0.1",
49
- "espree": "9.0.0",
48
+ "eslint-plugin-unicorn": "^39.0.0",
49
+ "espree": "9.1.0",
50
50
  "settingz": "^0.1.0"
51
51
  },
52
52
  "peerDependencies": {