-
Notifications
You must be signed in to change notification settings - Fork 834
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: move to ESLint Flat Config (#3003)
* chore: move to ESLint Flat Config * fix: add gitignore
- Loading branch information
Showing
184 changed files
with
1,508 additions
and
996 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,3 +39,6 @@ pnpm-debug.log* | |
|
||
# vitest | ||
/html | ||
|
||
# packages/nutui-taro-demo | ||
/packages/nutui-taro-demo/src/app.config.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import NutUI from '@nutui/eslint-config' | ||
import gitignore from 'eslint-config-flat-gitignore' | ||
|
||
export default [ | ||
gitignore(), | ||
...NutUI | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,64 @@ | ||
module.exports = { | ||
extends: ['plugin:vue/base', 'eslint:recommended', 'plugin:vue/vue3-recommended', 'prettier'], | ||
parser: 'vue-eslint-parser', | ||
parserOptions: { | ||
parser: '@typescript-eslint/parser', | ||
ecmaVersion: 2020, | ||
sourceType: 'module', | ||
ecmaFeatures: { | ||
jsx: true | ||
import pluginJs from '@eslint/js' | ||
import pluginVue from 'eslint-plugin-vue' | ||
import pluginTs from 'typescript-eslint' | ||
import stylistic from '@stylistic/eslint-plugin' | ||
|
||
import parserVue from 'vue-eslint-parser' | ||
import parserTs from '@typescript-eslint/parser' | ||
|
||
export default [ | ||
pluginJs.configs.recommended, | ||
stylistic.configs.customize({ | ||
quoteProps: 'as-needed', | ||
commaDangle: 'never', | ||
braceStyle: '1tbs' | ||
}), | ||
...pluginTs.configs.recommended, | ||
...pluginVue.configs['flat/recommended'], | ||
{ | ||
rules: { | ||
// typescript-eslint | ||
'@typescript-eslint/no-explicit-any': 'off', | ||
'@typescript-eslint/ban-types': 'off', | ||
'@typescript-eslint/no-var-requires': 'off', | ||
'no-unused-vars': 'off', | ||
'@typescript-eslint/no-unused-vars': 'error', | ||
'@typescript-eslint/ban-ts-comment': 'off', | ||
// eslint-plugin-vue | ||
'vue/v-on-event-hyphenation': [ | ||
'error', | ||
'always', | ||
{ | ||
autofix: true | ||
} | ||
], | ||
'vue/no-v-html': 'off', | ||
'vue/max-attributes-per-line': 'off', | ||
'vue/first-attribute-linebreak': 'off', | ||
'vue/multi-word-component-names': 'off', | ||
'vue/no-v-text-v-html-on-component': 'off', | ||
// TODO: will be removed | ||
'vue/html-self-closing': 'off', | ||
'vue/html-closing-bracket-newline': 'off', | ||
'vue/singleline-html-element-content-newline': 'off' | ||
} | ||
}, | ||
plugins: ['vue', '@typescript-eslint'], | ||
env: { | ||
es6: true, | ||
node: true, | ||
browser: true, | ||
jest: true | ||
}, | ||
globals: { | ||
vi: true, | ||
NodeJS: true, | ||
TaroGeneral: true | ||
}, | ||
rules: { | ||
// basic | ||
semi: [2, 'never'], | ||
// @typescript-eslint | ||
'@typescript-eslint/no-explicit-any': 'off', | ||
'@typescript-eslint/ban-types': 'off', | ||
'@typescript-eslint/no-var-requires': 'off', | ||
'no-unused-vars': 'off', | ||
'@typescript-eslint/no-unused-vars': 'error', | ||
// eslint-plugin-vue | ||
'vue/v-on-event-hyphenation': [ | ||
'error', | ||
'always', | ||
{ | ||
autofix: true | ||
{ | ||
languageOptions: { | ||
parser: parserVue, | ||
globals: { | ||
vi: true, | ||
NodeJS: true, | ||
TaroGeneral: true | ||
}, | ||
parserOptions: { | ||
parser: parserTs, | ||
ecmaVersion: 2020, | ||
sourceType: 'module', | ||
ecmaFeatures: { | ||
jsx: true | ||
} | ||
} | ||
], | ||
'vue/no-v-html': 'off', | ||
'vue/first-attribute-linebreak': 'off', | ||
'vue/multi-word-component-names': 'off', | ||
'vue/no-v-text-v-html-on-component': 'off' | ||
} | ||
} | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 5 additions & 3 deletions
8
packages/nutui-taro-demo/src/dentry/pages/checkbox/methods.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.