@nice-move/eslint-config-base 0.5.69 → 0.5.73

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/index.cjs CHANGED
@@ -5,17 +5,19 @@ const {
5
5
  matches: { sourceAndPackages },
6
6
  } = require('./lib/utils.cjs');
7
7
 
8
+ const { readJson, getPkg } = require('settingz');
9
+
10
+ function ignoreList() {
11
+ const { ignore: { all = [], eslint = [] } = {} } = getPkg('nice-move');
12
+
13
+ return [...all, ...eslint];
14
+ }
15
+
8
16
  function BestShot() {
9
- try {
10
- const {
11
- git = [],
12
- eslint = git, // @ts-ignore
13
- // eslint-disable-next-line import/no-unresolved
14
- } = require('@best-shot/cli/config/ignore.json');
15
- return eslint;
16
- } catch {
17
- return [];
18
- }
17
+ const { git = [], eslint = git } = readJson(
18
+ '@best-shot/cli/config/ignore.json',
19
+ );
20
+ return eslint;
19
21
  }
20
22
 
21
23
  module.exports = {
@@ -59,5 +61,6 @@ module.exports = {
59
61
  '**/miniprogram_npm/**',
60
62
  'node_modules/',
61
63
  ...BestShot(),
64
+ ...ignoreList(),
62
65
  ],
63
66
  };
package/lib/base.cjs CHANGED
@@ -13,6 +13,8 @@ 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
  },
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
@@ -29,6 +29,18 @@ module.exports = {
29
29
  'node/process-exit-as-throw': 'error',
30
30
  },
31
31
  },
32
+ {
33
+ files: '*.*',
34
+ excludedFiles: ['**/*.md/*', '*.cjs', '*.md'],
35
+ rules: {
36
+ 'node/file-extension-in-import': 'error',
37
+ },
38
+ settings: {
39
+ node: {
40
+ tryExtensions: ['.vue', '.tsx', '.jsx', '.ts', '.js'],
41
+ },
42
+ },
43
+ },
32
44
  {
33
45
  // for node.js
34
46
  files: '*.mjs',
@@ -44,7 +56,7 @@ module.exports = {
44
56
  },
45
57
  settings: {
46
58
  node: {
47
- tryExtensions: ['.mjs', '.cjs', '.js'],
59
+ tryExtensions: ['.mjs', '.cjs', '.js', '.ts'],
48
60
  },
49
61
  },
50
62
  rules: {
@@ -66,18 +78,10 @@ module.exports = {
66
78
  strict: ['error', 'global'],
67
79
  'node/no-exports-assign': 'error',
68
80
  'node/no-new-require': 'error',
69
- },
70
- },
71
- {
72
- files: '*.{js,ts,jsx,tsx,vue,html,htm}',
73
- excludedFiles: ['**/*.md/*'],
74
- rules: {
75
- 'node/file-extension-in-import': 'error',
76
- },
77
- settings: {
78
- node: {
79
- tryExtensions: ['.vue', '.tsx', '.jsx', '.ts', '.js'],
80
- },
81
+ 'node/no-unsupported-features/es-syntax': [
82
+ 'error',
83
+ { ignores: ['dynamicImport'] },
84
+ ],
81
85
  },
82
86
  },
83
87
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nice-move/eslint-config-base",
3
- "version": "0.5.69",
3
+ "version": "0.5.73",
4
4
  "description": "A `eslint` config for best practice",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -34,8 +34,8 @@
34
34
  },
35
35
  "main": "index.cjs",
36
36
  "dependencies": {
37
- "@typescript-eslint/eslint-plugin": "^5.3.1",
38
- "@typescript-eslint/parser": "^5.3.1",
37
+ "@typescript-eslint/eslint-plugin": "^5.4.0",
38
+ "@typescript-eslint/parser": "^5.4.0",
39
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",
@@ -45,9 +45,9 @@
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": "^38.0.1",
49
- "espree": "9.0.0",
50
- "settingz": "^0.1.0"
48
+ "eslint-plugin-unicorn": "^39.0.0",
49
+ "espree": "9.1.0",
50
+ "settingz": "^0.1.2"
51
51
  },
52
52
  "peerDependencies": {
53
53
  "eslint": "^7.32.0"