fix: update to newest version of eslint

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
This commit is contained in:
Vitor Mattos 2025-10-14 13:43:53 -03:00
parent 19f5ef68de
commit f94168e22a
No known key found for this signature in database
GPG key ID: 6FECE2AD4809003A
3 changed files with 100 additions and 82 deletions

View file

@ -1,80 +0,0 @@
/**
* SPDX-FileCopyrightText: 2024 LibreCode coop and contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
module.exports = {
globals: {
appName: true,
},
extends: [
'@nextcloud',
],
rules: {
// production only
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'warn',
'vue/no-unused-components': process.env.NODE_ENV === 'production' ? 'error' : 'warn',
'import/order': [
'error',
{
groups: ['builtin', 'external', 'internal', ['parent', 'sibling', 'index'], 'unknown'],
pathGroups: [
{
// group all style imports at the end
pattern: '{*.css,*.scss}',
patternOptions: { matchBase: true },
group: 'unknown',
position: 'after',
},
{
// group material design icons
pattern: 'vue-material-design-icons/**',
group: 'external',
position: 'after',
},
{
// group @nextcloud imports
pattern: '@nextcloud/{!(vue),!(vue)/**}',
group: 'external',
position: 'after',
},
{
// group @nextcloud/vue imports
pattern: '{@nextcloud/vue,@nextcloud/vue/**}',
group: 'external',
position: 'after',
},
{
// group project components
pattern: '*.vue',
patternOptions: { matchBase: true },
group: 'parent',
position: 'before',
},
],
pathGroupsExcludedImportTypes: ['@nextcloud', 'vue-material-design-icons'],
'newlines-between': 'always',
alphabetize: {
order: 'asc',
caseInsensitive: true,
},
warnOnUnassignedImports: true,
},
],
'import/no-unresolved': ['error', {
// Ignore Webpack query parameters, not supported by eslint-plugin-import
// https://github.com/import-js/eslint-plugin-import/issues/2562
ignore: ['\\?raw$'],
}],
},
overrides: [
{
files: ['src/types/openapi/*.ts'],
rules: {
'@typescript-eslint/no-explicit-any': 'off',
quotes: 'off',
'no-multiple-empty-lines': 'off',
'no-use-before-define': 'off',
},
},
],
}

98
eslint.config.mjs Normal file
View file

@ -0,0 +1,98 @@
/**
* SPDX-FileCopyrightText: 2024 LibreCode coop and contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
import nextcloudConfig from '@nextcloud/eslint-config'
import globals from 'globals'
export default [
...(Array.isArray(nextcloudConfig) ? nextcloudConfig : [nextcloudConfig]),
{
name: 'libresign/ignores',
ignores: [
// Generated files
'src/types/openapi/*',
'js/*',
// Build artifacts
'build/*',
// Node modules
'node_modules/*',
// TODO: upstream
'openapi-*.json',
],
},
{
name: 'libresign/config',
rules: {
// production only
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'warn',
'vue/no-unused-components': process.env.NODE_ENV === 'production' ? 'error' : 'warn',
'import/order': [
'error',
{
groups: ['builtin', 'external', 'internal', ['parent', 'sibling', 'index'], 'unknown'],
pathGroups: [
{
// group all style imports at the end
pattern: '{*.css,*.scss}',
patternOptions: { matchBase: true },
group: 'unknown',
position: 'after',
},
{
// group material design icons
pattern: 'vue-material-design-icons/**',
group: 'external',
position: 'after',
},
{
// group @nextcloud imports
pattern: '@nextcloud/{!(vue),!(vue)/**}',
group: 'external',
position: 'after',
},
{
// group @nextcloud/vue imports
pattern: '{@nextcloud/vue,@nextcloud/vue/**}',
group: 'external',
position: 'after',
},
{
// group project components
pattern: '*.vue',
patternOptions: { matchBase: true },
group: 'parent',
position: 'before',
},
],
pathGroupsExcludedImportTypes: ['@nextcloud', 'vue-material-design-icons'],
'newlines-between': 'always',
alphabetize: {
order: 'asc',
caseInsensitive: true,
},
warnOnUnassignedImports: true,
},
],
'import/no-unresolved': ['error', {
// Ignore Webpack query parameters, not supported by eslint-plugin-import
// https://github.com/import-js/eslint-plugin-import/issues/2562
ignore: ['\\?raw$'],
}],
},
},
{
name: 'libresign/openapi-overrides',
files: ['src/types/openapi/*.ts'],
rules: {
'@typescript-eslint/no-explicit-any': 'off',
quotes: 'off',
'no-multiple-empty-lines': 'off',
'no-use-before-define': 'off',
},
},
]

View file

@ -11,8 +11,8 @@
"serve": "webpack serve --node-env development --progress --allowed-hosts all --host 0.0.0.0",
"typescript:check": "tsc --noEmit",
"typescript:generate": "npx openapi-typescript -t",
"lint": "eslint --ext .js,.vue src",
"lint:fix": "eslint --ext .js,.vue src --fix",
"lint": "eslint",
"lint:fix": "eslint --fix",
"stylelint": "stylelint css/*.css css/*.scss src/**/*.scss src/**/*.vue",
"stylelint:fix": "stylelint css/*.css css/*.scss src/**/*.scss src/**/*.vue --fix",
"test": "jest",