Skip to content

Commit 14451b5

Browse files
authored
Merge pull request #5570 from LibreSign/fix/eslint
fix: update to newest version of eslint
2 parents e6ccbce + f94168e commit 14451b5

3 files changed

Lines changed: 100 additions & 82 deletions

File tree

.eslintrc.js

Lines changed: 0 additions & 80 deletions
This file was deleted.

eslint.config.mjs

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
/**
2+
* SPDX-FileCopyrightText: 2024 LibreCode coop and contributors
3+
* SPDX-License-Identifier: AGPL-3.0-or-later
4+
*/
5+
6+
import nextcloudConfig from '@nextcloud/eslint-config'
7+
import globals from 'globals'
8+
9+
export default [
10+
...(Array.isArray(nextcloudConfig) ? nextcloudConfig : [nextcloudConfig]),
11+
12+
{
13+
name: 'libresign/ignores',
14+
ignores: [
15+
// Generated files
16+
'src/types/openapi/*',
17+
'js/*',
18+
// Build artifacts
19+
'build/*',
20+
// Node modules
21+
'node_modules/*',
22+
// TODO: upstream
23+
'openapi-*.json',
24+
],
25+
},
26+
27+
{
28+
name: 'libresign/config',
29+
rules: {
30+
// production only
31+
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'warn',
32+
'vue/no-unused-components': process.env.NODE_ENV === 'production' ? 'error' : 'warn',
33+
'import/order': [
34+
'error',
35+
{
36+
groups: ['builtin', 'external', 'internal', ['parent', 'sibling', 'index'], 'unknown'],
37+
pathGroups: [
38+
{
39+
// group all style imports at the end
40+
pattern: '{*.css,*.scss}',
41+
patternOptions: { matchBase: true },
42+
group: 'unknown',
43+
position: 'after',
44+
},
45+
{
46+
// group material design icons
47+
pattern: 'vue-material-design-icons/**',
48+
group: 'external',
49+
position: 'after',
50+
},
51+
{
52+
// group @nextcloud imports
53+
pattern: '@nextcloud/{!(vue),!(vue)/**}',
54+
group: 'external',
55+
position: 'after',
56+
},
57+
{
58+
// group @nextcloud/vue imports
59+
pattern: '{@nextcloud/vue,@nextcloud/vue/**}',
60+
group: 'external',
61+
position: 'after',
62+
},
63+
{
64+
// group project components
65+
pattern: '*.vue',
66+
patternOptions: { matchBase: true },
67+
group: 'parent',
68+
position: 'before',
69+
},
70+
],
71+
pathGroupsExcludedImportTypes: ['@nextcloud', 'vue-material-design-icons'],
72+
'newlines-between': 'always',
73+
alphabetize: {
74+
order: 'asc',
75+
caseInsensitive: true,
76+
},
77+
warnOnUnassignedImports: true,
78+
},
79+
],
80+
'import/no-unresolved': ['error', {
81+
// Ignore Webpack query parameters, not supported by eslint-plugin-import
82+
// https://github.com/import-js/eslint-plugin-import/issues/2562
83+
ignore: ['\\?raw$'],
84+
}],
85+
},
86+
},
87+
88+
{
89+
name: 'libresign/openapi-overrides',
90+
files: ['src/types/openapi/*.ts'],
91+
rules: {
92+
'@typescript-eslint/no-explicit-any': 'off',
93+
quotes: 'off',
94+
'no-multiple-empty-lines': 'off',
95+
'no-use-before-define': 'off',
96+
},
97+
},
98+
]

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
"serve": "webpack serve --node-env development --progress --allowed-hosts all --host 0.0.0.0",
1212
"typescript:check": "tsc --noEmit",
1313
"typescript:generate": "npx openapi-typescript -t",
14-
"lint": "eslint --ext .js,.vue src",
15-
"lint:fix": "eslint --ext .js,.vue src --fix",
14+
"lint": "eslint",
15+
"lint:fix": "eslint --fix",
1616
"stylelint": "stylelint css/*.css css/*.scss src/**/*.scss src/**/*.vue",
1717
"stylelint:fix": "stylelint css/*.css css/*.scss src/**/*.scss src/**/*.vue --fix",
1818
"test": "jest",

0 commit comments

Comments
 (0)