-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Kangrui Johann Ye <kangrui.ye@cloudflight.io>
- Loading branch information
1 parent
5722c41
commit c1d9561
Showing
14 changed files
with
166 additions
and
450 deletions.
There are no files selected for viewing
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 was deleted.
Oops, something went wrong.
58 changes: 0 additions & 58 deletions
58
packages/eslint-plugin-vue/src/configs/recommended/recommended.config.ts
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import {TSESLint} from '@typescript-eslint/utils'; | ||
|
||
export const typescriptRules: TSESLint.Linter.RulesRecord = { | ||
// vue.js components have the any type when used with typescript import | ||
// such as `import MyComponent from './my-component.vue'` | ||
'@typescript-eslint/no-unsafe-assignment': '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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import {TSESLint} from '@typescript-eslint/utils'; | ||
|
||
const htmlIndent = 4; | ||
|
||
export const vueRules: TSESLint.Linter.RulesRecord = { | ||
'vue/block-lang': [ | ||
'error', | ||
{ | ||
script: { | ||
lang: 'ts', | ||
}, | ||
style: { | ||
lang: 'scss', | ||
}, | ||
}, | ||
], | ||
'vue/component-api-style': ['error', ['script-setup', 'composition']], | ||
'vue/define-emits-declaration': ['error', 'type-based'], | ||
'vue/define-props-declaration': ['error', 'type-based'], | ||
'vue/define-macros-order': [ | ||
'error', | ||
{ | ||
order: ['defineProps', 'defineEmits'], | ||
}, | ||
], | ||
'vue/html-button-has-type': 'error', | ||
'vue/html-indent': ['error', htmlIndent], | ||
'vue/no-ref-object-destructure': 'error', | ||
'vue/no-undef-properties': 'error', | ||
}; |
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,2 +1,28 @@ | ||
export {configs} from './configs'; | ||
export {rules} from './rules'; | ||
import tseslint from 'typescript-eslint'; | ||
import { cloudflightTypescriptConfig } from '@cloudflight/eslint-plugin-typescript'; | ||
import {TSESLint} from '@typescript-eslint/utils'; | ||
// @ts-expect-error .d.ts file for eslint-plugin-vue has been implemented but not released yet | ||
// if the following line fails to build after updating the version, simply remove this comment | ||
import pluginVue from 'eslint-plugin-vue'; | ||
import vueTsEslintConfig from '@vue/eslint-config-typescript'; | ||
import {typescriptRules} from './configs/typescript'; | ||
import {vueRules} from './configs/vue'; | ||
|
||
export const cloudflightVueConfig = tseslint.config( | ||
...cloudflightTypescriptConfig, | ||
{ | ||
files: ['**/*.vue'], | ||
extends: [ | ||
...cloudflightTypescriptConfig, | ||
// .d.ts file for eslint-plugin-vue has been implemented but not released yet, if the | ||
// following line fails to build after updating the version, simply remove this comment | ||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access,@typescript-eslint/consistent-type-assertions | ||
...pluginVue.configs['flat/recommended'] as TSESLint.FlatConfig.ConfigArray, | ||
...vueTsEslintConfig(), | ||
], | ||
rules: { | ||
...typescriptRules, | ||
...vueRules, | ||
} | ||
}, | ||
); |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.