-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_.eslintrc.cjs
43 lines (40 loc) · 1.59 KB
/
_.eslintrc.cjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/* eslint-env node */
const editorConfig = require('editorconfig');
const parsedConfig = editorConfig.parseSync('./.editorconfig');
/**
* @type {{ [Key in keyof editorConfig.KnownProps]: Exclude<editorConfig.KnownProps[Key], "unset"> }}
*/
const { indent_size, end_of_line, insert_final_newline, trim_trailing_whitespace } = {
indent_size: parsedConfig.indent_size === 'unset' ? 4 : parsedConfig.indent_size,
end_of_line: parsedConfig.end_of_line === 'unset' ? 'unix' : parsedConfig.end_of_line === 'crlf' ? 'windows' : 'unix',
insert_final_newline: parsedConfig.insert_final_newline === 'unset' ? false : parsedConfig.insert_final_newline,
trim_trailing_whitespace: parsedConfig.trim_trailing_whitespace === 'unset' ? true : parsedConfig.trim_trailing_whitespace,
};
/**
* @type {import("eslint").ESLint.ConfigData}
*/
module.exports = {
root: true,
plugins: ['@stylistic'],
extends: [
'plugin:vue/vue3-essential',
'eslint:recommended',
'@vue/eslint-config-typescript',
],
overrides: [
{
files: ['cypress/e2e/**/*.{cy,spec}.{js,ts,jsx,tsx}'],
extends: ['plugin:cypress/recommended'],
},
],
rules: {
'@stylistic/indent': ['error', indent_size],
'@stylistic/eol-last': ['error', insert_final_newline ? 'always' : 'never'],
'@stylistic/linebreak-style': ['error', end_of_line],
'@stylistic/no-trailing-spaces': trim_trailing_whitespace ? 'error' : 'off',
'@stylistic/brace-style': ['error', 'allman'],
},
parserOptions: {
ecmaVersion: 'latest',
},
};