chore: setup eslint for prohibited syntax (#8516)

This commit is contained in:
neverland 2021-04-13 11:14:56 +08:00 committed by GitHub
parent 9deca34d1d
commit 6e24ba42a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 2 deletions

View File

@ -1,4 +1,20 @@
{
"root": true,
"extends": ["@vant"]
"extends": ["@vant"],
"overrides": [
{
"files": ["src/**/*"],
"excludedFiles": ["**/test/*", "**/demo/*"],
"rules": {
"prefer-object-spread": "off",
// since we target ES2015 for baseline support, we need to forbid object
// rest spread usage (both assign and destructure)
"no-restricted-syntax": [
"error",
"ObjectExpression > SpreadElement",
"ObjectPattern > RestElement"
]
}
}
]
}

View File

@ -69,7 +69,7 @@ module.exports = {
overrides: [
{
files: ['*.vue'],
parser: require.resolve('vue-eslint-parser')
parser: require.resolve('vue-eslint-parser'),
},
{
files: ['**/*.md/*.js', '**/*.md/*.ts'],