@nextcloud/eslint-config 8.4.2 → 9.0.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +27 -0
- package/README.md +102 -28
- package/dist/index.d.ts +31 -0
- package/dist/index.mjs +1464 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +51 -53
- package/.git-blame-ignore-revs +0 -7
- package/LICENSES/AGPL-3.0-or-later.txt +0 -235
- package/LICENSES/CC0-1.0.txt +0 -121
- package/LICENSES/MIT.txt +0 -9
- package/REUSE.toml +0 -12
- package/index.js +0 -25
- package/parts/base.js +0 -117
- package/parts/typescript.js +0 -49
- package/parts/vue.js +0 -45
- package/parts/vue3.js +0 -43
- package/typescript.js +0 -45
- package/vue3.js +0 -45
package/parts/vue3.js
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
|
|
3
|
-
* SPDX-License-Identifier: AGPL-3.0-or-later
|
|
4
|
-
*/
|
|
5
|
-
module.exports = {
|
|
6
|
-
files: ['**/*.vue'],
|
|
7
|
-
parser: 'vue-eslint-parser',
|
|
8
|
-
parserOptions: {
|
|
9
|
-
parser: '@babel/eslint-parser',
|
|
10
|
-
},
|
|
11
|
-
extends: ['plugin:vue/vue3-recommended'],
|
|
12
|
-
rules: {
|
|
13
|
-
'vue/html-indent': ['error', 'tab'],
|
|
14
|
-
// PascalCase components names for vuejs
|
|
15
|
-
// https://vuejs.org/style-guide/rules-strongly-recommended.html#component-name-casing-in-templates
|
|
16
|
-
'vue/component-name-in-template-casing': ['error', 'PascalCase'],
|
|
17
|
-
// force name
|
|
18
|
-
'vue/match-component-file-name': ['error', {
|
|
19
|
-
extensions: ['jsx', 'vue', 'js', 'ts', 'tsx'],
|
|
20
|
-
shouldMatchCase: true,
|
|
21
|
-
}],
|
|
22
|
-
// space before self-closing elements
|
|
23
|
-
'vue/html-closing-bracket-spacing': 'error',
|
|
24
|
-
// no ending html tag on a new line
|
|
25
|
-
'vue/html-closing-bracket-newline': ['error', { multiline: 'never' }],
|
|
26
|
-
// check vue files too
|
|
27
|
-
'n/no-missing-import': ['error', {}],
|
|
28
|
-
// code spacing with attributes
|
|
29
|
-
'vue/max-attributes-per-line': ['error', {
|
|
30
|
-
singleline: 3,
|
|
31
|
-
multiline: 1,
|
|
32
|
-
}],
|
|
33
|
-
// See https://vuejs.org/style-guide/rules-strongly-recommended.html#multi-attribute-elements
|
|
34
|
-
'vue/first-attribute-linebreak': ['error', {
|
|
35
|
-
singleline: 'beside',
|
|
36
|
-
multiline: 'beside',
|
|
37
|
-
}],
|
|
38
|
-
// Allow single-word components names
|
|
39
|
-
'vue/multi-word-component-names': ['off'],
|
|
40
|
-
// custom event naming convention
|
|
41
|
-
'vue/custom-event-name-casing': 'warn',
|
|
42
|
-
},
|
|
43
|
-
}
|
package/typescript.js
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
|
|
3
|
-
* SPDX-License-Identifier: AGPL-3.0-or-later
|
|
4
|
-
*/
|
|
5
|
-
const base = require('./parts/base.js')
|
|
6
|
-
const typescriptOverrides = require('./parts/typescript.js')
|
|
7
|
-
const vueOverrides = require('./parts/vue.js')
|
|
8
|
-
|
|
9
|
-
// Use different parser for vue files script section
|
|
10
|
-
vueOverrides.parserOptions = {
|
|
11
|
-
parser: '@typescript-eslint/parser',
|
|
12
|
-
sourceType: 'module',
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
// Override vue rules with rules for Typescript
|
|
16
|
-
vueOverrides.rules = {
|
|
17
|
-
...vueOverrides.rules,
|
|
18
|
-
...typescriptOverrides.rules,
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
// Add settings, required for import resolver
|
|
22
|
-
vueOverrides.settings = {
|
|
23
|
-
...(vueOverrides.settings || []),
|
|
24
|
-
...typescriptOverrides.settings,
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
// Also extend from vue typescript eslint
|
|
28
|
-
vueOverrides.extends.push('@vue/eslint-config-typescript/recommended')
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Config for projects written in Typescript + vue including vue files written in Typescript (`<script lang='ts'>`)
|
|
32
|
-
*/
|
|
33
|
-
module.exports = {
|
|
34
|
-
...base,
|
|
35
|
-
overrides: [
|
|
36
|
-
// Overrides for Typescript files
|
|
37
|
-
{
|
|
38
|
-
...typescriptOverrides,
|
|
39
|
-
},
|
|
40
|
-
// Setup different vue parser to support `<script setup>` correctly, especially for `lang="ts"`
|
|
41
|
-
{
|
|
42
|
-
...vueOverrides,
|
|
43
|
-
},
|
|
44
|
-
],
|
|
45
|
-
}
|
package/vue3.js
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
|
|
3
|
-
* SPDX-License-Identifier: AGPL-3.0-or-later
|
|
4
|
-
*/
|
|
5
|
-
const base = require('./parts/base.js')
|
|
6
|
-
const typescriptOverrides = require('./parts/typescript.js')
|
|
7
|
-
const vueOverrides = require('./parts/vue3.js')
|
|
8
|
-
|
|
9
|
-
// Use different parser for vue files script section
|
|
10
|
-
vueOverrides.parserOptions = {
|
|
11
|
-
parser: '@typescript-eslint/parser',
|
|
12
|
-
sourceType: 'module',
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
// Override vue rules with rules for Typescript
|
|
16
|
-
vueOverrides.rules = {
|
|
17
|
-
...vueOverrides.rules,
|
|
18
|
-
...typescriptOverrides.rules,
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
// Add settings, required for import resolver
|
|
22
|
-
vueOverrides.settings = {
|
|
23
|
-
...(vueOverrides.settings || []),
|
|
24
|
-
...typescriptOverrides.settings,
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
// Also extend from vue typescript eslint
|
|
28
|
-
vueOverrides.extends.push('@vue/eslint-config-typescript/recommended')
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Config for projects written in Typescript + vue including vue files written in Typescript (`<script lang='ts'>`)
|
|
32
|
-
*/
|
|
33
|
-
module.exports = {
|
|
34
|
-
...base,
|
|
35
|
-
overrides: [
|
|
36
|
-
// Overrides for Typescript files
|
|
37
|
-
{
|
|
38
|
-
...typescriptOverrides,
|
|
39
|
-
},
|
|
40
|
-
// Setup different vue parser to support `<script setup>` correctly, especially for `lang="ts"`
|
|
41
|
-
{
|
|
42
|
-
...vueOverrides,
|
|
43
|
-
},
|
|
44
|
-
],
|
|
45
|
-
}
|