mirror of
https://github.com/jellyfin/jellyfin-vue.git
synced 2024-12-02 19:16:40 +00:00
f00e53575a
There is still a missing plugin and typescript-eslint v8 needs to be published, but this is already in a good enough state to be updated and there are only minor things missing. Signed-off-by: Fernando Fernández <ferferga@hotmail.com>
82 lines
2.2 KiB
Plaintext
82 lines
2.2 KiB
Plaintext
/**
|
|
* This file will be here for a while while we get accostumed to ESLint v9.
|
|
* The running ESLint configuration is currently at eslint.config.js
|
|
*
|
|
* The rules here have not been migrated to the new flat config format, and
|
|
* here are some reasons why.
|
|
*
|
|
* Lots of the rules were not defined in the flat config file because they were
|
|
* already using the default values (tested using ESLint Config Inspector).
|
|
*/
|
|
|
|
module.exports = {
|
|
rules: {
|
|
// Only that option was different from the default values
|
|
'@stylistic/indent': ['error', 2, {
|
|
'VariableDeclarator': 2,
|
|
}],
|
|
// This rule is annoying when commenting code pieces
|
|
'capitalized-comments': [
|
|
'error', 'always',
|
|
{
|
|
'ignoreInlineComments': true,
|
|
ignoreConsecutiveComments: true
|
|
}],
|
|
// This rule made sense in Options API, but atm is really verbose
|
|
'@typescript-eslint/explicit-function-return-type': 'error'
|
|
},
|
|
/**
|
|
* Overrides allows us to omit the --ext CLI argument, simplifying package.json scripts section
|
|
*/
|
|
overrides: [
|
|
{
|
|
files: ['*.md'],
|
|
rules: {
|
|
'@stylistic/no-trailing-spaces': ['off'],
|
|
'no-secrets/no-secrets': 'error'
|
|
}
|
|
},
|
|
// This parser configuration doesn't work correctly in ESLint v9
|
|
{
|
|
files: ['*.ts', '*.tsx'],
|
|
parser: 'typescript-eslint-parser-for-extra-files',
|
|
parserOptions: {
|
|
parser: '@typescript-eslint/parser',
|
|
sourceType: 'module',
|
|
project: 'tsconfig.json',
|
|
extraFileExtensions: ['.vue']
|
|
},
|
|
...commonTSAndVueConfig
|
|
},
|
|
{
|
|
files: ['*.vue'],
|
|
parser: 'vue-eslint-parser',
|
|
parserOptions: {
|
|
parser: 'typescript-eslint-parser-for-extra-files',
|
|
project: 'tsconfig.json',
|
|
sourceType: 'module'
|
|
},
|
|
...commonTSAndVueConfig
|
|
},
|
|
// import plugin is still not working with ESLint v9
|
|
{
|
|
files: ['vite.config.ts', 'scripts/**/*.ts'],
|
|
rules: {
|
|
'import/no-nodejs-modules': 'off'
|
|
}
|
|
},
|
|
{
|
|
files: ['*.d.ts'],
|
|
rules: {
|
|
'multiline-comment-style': 'off'
|
|
}
|
|
}
|
|
],
|
|
settings: {
|
|
'import/resolver': {
|
|
typescript: true,
|
|
node: false
|
|
}
|
|
}
|
|
};
|