@mpxjs/vue-cli-plugin-mpx-eslint 1.6.2 → 1.6.3
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/generator/index.js +3 -15
- package/generator/template/_eslintrc.js +11 -28
- package/package.json +1 -1
package/generator/index.js
CHANGED
|
@@ -1,25 +1,13 @@
|
|
|
1
1
|
module.exports = function (api, options = {}) {
|
|
2
2
|
api.extendPackage({
|
|
3
3
|
scripts: {
|
|
4
|
-
lint: 'eslint --ext .js,.mpx src/'
|
|
4
|
+
lint: 'eslint --ext .js,.ts,.mpx src/'
|
|
5
5
|
},
|
|
6
6
|
devDependencies: {
|
|
7
7
|
'eslint-webpack-plugin': '^3.1.1',
|
|
8
|
-
'babel-eslint': '^10.0.1',
|
|
9
8
|
eslint: '^7.0.0',
|
|
10
|
-
'eslint-config
|
|
11
|
-
'eslint-config-standard': '^12.0.0',
|
|
12
|
-
'eslint-friendly-formatter': '^4.0.1',
|
|
13
|
-
'eslint-plugin-html': '^6.0.1',
|
|
14
|
-
'eslint-plugin-import': '^2.14.0',
|
|
15
|
-
'eslint-plugin-local-rules': '^0.1.0',
|
|
16
|
-
'eslint-plugin-node': '^8.0.0',
|
|
17
|
-
'eslint-plugin-prettier': '^2.6.2',
|
|
18
|
-
'eslint-plugin-promise': '^4.0.1',
|
|
19
|
-
'eslint-plugin-standard': '^4.0.0'
|
|
9
|
+
'@mpxjs/eslint-config': '^1.0.3'
|
|
20
10
|
}
|
|
21
11
|
})
|
|
22
|
-
api.render('./template'
|
|
23
|
-
needTs: !!options.needTs
|
|
24
|
-
})
|
|
12
|
+
api.render('./template')
|
|
25
13
|
}
|
|
@@ -1,37 +1,20 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
-
|
|
3
|
-
parser: 'babel-eslint',
|
|
4
|
-
parserOptions: {
|
|
5
|
-
sourceType: 'module'
|
|
6
|
-
},
|
|
7
|
-
extends: 'standard',
|
|
8
|
-
settings: {
|
|
9
|
-
'html/html-extensions': ['.html', '.mpx'], // consider .html and .mpx files as HTML
|
|
10
|
-
},
|
|
11
|
-
plugins: [
|
|
12
|
-
'html'
|
|
13
|
-
],
|
|
14
|
-
globals: {
|
|
15
|
-
wx: true,
|
|
16
|
-
getApp: true,
|
|
17
|
-
App: true,
|
|
18
|
-
__mpx_mode__: true
|
|
19
|
-
},
|
|
2
|
+
extends: ['@mpxjs'],
|
|
20
3
|
rules: {
|
|
21
|
-
|
|
4
|
+
// .mpx文件规则 https://mpx-ecology.github.io/eslint-plugin-mpx/rules/
|
|
22
5
|
},
|
|
23
|
-
<%_ if(needTs) { _%>
|
|
24
6
|
overrides: [
|
|
25
7
|
{
|
|
26
8
|
files: ['**/*.ts'],
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
],
|
|
33
|
-
|
|
9
|
+
rules: {
|
|
10
|
+
// .ts文件规则 https://typescript-eslint.io/rules/
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
files: ['**/*.js'],
|
|
15
|
+
rules: {
|
|
16
|
+
// .js文件规则 https://eslint.bootcss.com/docs/rules/
|
|
17
|
+
}
|
|
34
18
|
}
|
|
35
19
|
]
|
|
36
|
-
<%_ } _%>
|
|
37
20
|
}
|