mirror of
https://github.com/jellyfin/jellyfin-vue.git
synced 2024-12-02 19:16:40 +00:00
c84097d9ad
The old configuration file has been left to keep a track of rules that have not been migrated to the new format, either because they're worthless (like the ones from the promise plugin, which are now cincluded by TypeScript) or too annoying for the minor added benefit. Signed-off-by: Fernando Fernández <ferferga@hotmail.com>
89 lines
2.6 KiB
Plaintext
89 lines
2.6 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 should be enforced by properly setting the env var in the flat config file.
|
|
'no-restricted-globals': ['error', ...restrictedGlobals],
|
|
// Promise plugin is still not working with ESLint v9
|
|
'promise/no-nesting': 'error',
|
|
'promise/no-return-in-finally': 'error',
|
|
'promise/prefer-await-to-callbacks': 'error',
|
|
'promise/prefer-await-to-then': 'error',
|
|
// 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
|
|
}
|
|
}
|
|
};
|