Skip to content

Commit

Permalink
Merge pull request #11686 from rancher/vue3-release
Browse files Browse the repository at this point in the history
Vue3 migration
  • Loading branch information
codyrancher authored Aug 23, 2024
2 parents 3db111e + 318e6fe commit a196848
Show file tree
Hide file tree
Showing 774 changed files with 40,858 additions and 12,781 deletions.
255 changes: 162 additions & 93 deletions .eslintrc.default.js
Original file line number Diff line number Diff line change
@@ -1,107 +1,175 @@
module.exports = {
// root: true,
env: {
browser: true,
node: true
},
globals: { NodeJS: true, Timer: true },
plugins: ['jest', '@typescript-eslint'],
globals: {
NodeJS: true,
Timer: true
},
plugins: [
'jest',
'@typescript-eslint'
],
extends: [
'standard',
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'@vue/standard',
'@vue/typescript/recommended',
'plugin:vue/recommended',
'plugin:cypress/recommended',
'plugin:vue/vue3-recommended',
'plugin:cypress/recommended'
],
rules: {

// Styling
'semi-spacing': 'off',
'space-in-parens': 'off',
'array-bracket-spacing': 'warn',
'arrow-parens': 'warn',
'arrow-spacing': ['warn', { before: true, after: true }],
'block-spacing': ['warn', 'always'],
'brace-style': ['warn', '1tbs'],
'comma-dangle': ['warn', 'only-multiline'],
'comma-spacing': 'warn',
indent: ['warn', 2],
'keyword-spacing': 'warn',
'newline-per-chained-call': ['warn', { ignoreChainWithDepth: 4 }],
'no-trailing-spaces': 'warn',
'func-call-spacing': ['warn', 'never'],
'wrap-iife': 'off',
'lines-between-class-members': ['warn', 'always', { exceptAfterSingleLine: true }],
'multiline-ternary': ['warn', 'never'],
'semi-spacing': 'off',
'space-in-parens': 'off',
'array-bracket-spacing': 'warn',
'arrow-parens': 'warn',
'arrow-spacing': [
'warn',
{
before: true,
after: true
}
],
'block-spacing': [
'warn',
'always'
],
'brace-style': [
'warn',
'1tbs'
],
'comma-dangle': [
'warn',
'only-multiline'
],
'comma-spacing': 'warn',
indent: [
'warn',
2
],
'keyword-spacing': 'warn',
'newline-per-chained-call': [
'warn',
{ ignoreChainWithDepth: 4 }
],
'no-trailing-spaces': 'warn',
'func-call-spacing': [
'warn',
'never'
],
'wrap-iife': 'off',
'lines-between-class-members': [
'warn',
'always',
{ exceptAfterSingleLine: true }
],
'multiline-ternary': [
'warn',
'never'
],
'no-whitespace-before-property': 'warn',
'object-curly-spacing': ['warn', 'always'],
'object-property-newline': 'warn',
'object-shorthand': 'warn',
'padded-blocks': ['warn', 'never'],
'quote-props': 'warn',
'rest-spread-spacing': 'warn',
semi: ['warn', 'always'],
'space-before-function-paren': ['warn', 'never'],
'space-infix-ops': 'warn',
'spaced-comment': 'warn',
'switch-colon-spacing': 'warn',
'template-curly-spacing': ['warn', 'always'],
'yield-star-spacing': ['warn', 'both'],
'key-spacing': ['warn', {
align: {
beforeColon: false,
afterColon: true,
on: 'value',
mode: 'strict'
},
multiLine: {
beforeColon: false,
afterColon: true
},
}],

'object-curly-newline': ['warn', {
ObjectExpression: {
multiline: true,
minProperties: 3
},
ObjectPattern: {
multiline: true,
minProperties: 4
},
ImportDeclaration: {
multiline: true,
minProperties: 5
},
ExportDeclaration: {
multiline: true,
minProperties: 3
'object-curly-spacing': [
'warn',
'always'
],
'object-property-newline': 'warn',
'object-shorthand': 'warn',
'padded-blocks': [
'warn',
'never'
],
'quote-props': 'warn',
'rest-spread-spacing': 'warn',
semi: [
'warn',
'always'
],
'space-before-function-paren': [
'warn',
'never'
],
'space-infix-ops': 'warn',
'spaced-comment': 'warn',
'switch-colon-spacing': 'warn',
'template-curly-spacing': [
'warn',
'always'
],
'yield-star-spacing': [
'warn',
'both'
],
'key-spacing': [
'warn',
{
align: {
beforeColon: false,
afterColon: true,
on: 'value',
mode: 'strict'
},
multiLine: {
beforeColon: false,
afterColon: true
}
}
],
'object-curly-newline': [
'warn',
{
ObjectExpression: {
multiline: true,
minProperties: 3
},
ObjectPattern: {
multiline: true,
minProperties: 4
},
ImportDeclaration: {
multiline: true,
minProperties: 5
},
ExportDeclaration: {
multiline: true,
minProperties: 3
}
}
}],
],
'padding-line-between-statements': [
'warn',
{
blankLine: 'always',
prev: '*',
next: 'return',
next: 'return'
},
{
blankLine: 'always',
prev: 'function',
next: 'function',
next: 'function'
},
// This configuration would require blank lines after every sequence of variable declarations
{
blankLine: 'always',
prev: ['const', 'let', 'var'],
next: '*'
prev: [
'const',
'let',
'var'
],
next: '*'
},
{
blankLine: 'any',
prev: ['const', 'let', 'var'],
next: ['const', 'let', 'var']
prev: [
'const',
'let',
'var'
],
next: [
'const',
'let',
'var'
]
}
],
quotes: [
Expand All @@ -110,28 +178,30 @@ module.exports = {
{
avoidEscape: true,
allowTemplateLiterals: true
},
}
],
'space-unary-ops': [
'warn',
{
words: true,
nonwords: false,
nonwords: false
}
],
'vue/one-component-per-file': 'off',
'vue/no-deprecated-slot-attribute': 'off',
'vue/require-explicit-emits': 'off',
'vue/v-on-event-hyphenation': 'off'
},
overrides: [
// TS Exceptions
{
files: ['**/*.{js,ts,vue}'],
files: [
'**/*.{js,ts,vue}'
],
rules: {
// Errors
'@typescript-eslint/no-empty-function': 'off', // Opinionated?
'@typescript-eslint/ban-types': 'off', // This does not seems to work well with Vue2
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/ban-types': 'off'
}
},

// Tests exceptions due mocks
{
files: [
'**/*.test.{js,ts}',
Expand All @@ -142,18 +212,17 @@ module.exports = {
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'jest/prefer-expect-assertions': 'off',
'jest/prefer-expect-assertions': 'off'
},
extends: ['plugin:jest/all']
extends: [
'plugin:jest/all'
]
},

// bug?
{
files: ['**/*.{js,vue}'],
rules: {
// Warnings
'@typescript-eslint/explicit-module-boundary-types': 'off',
}
},
files: [
'**/*.{js,vue}'
],
rules: { '@typescript-eslint/explicit-module-boundary-types': 'off' }
}
]
};
Loading

0 comments on commit a196848

Please sign in to comment.