fix(client): import shared ESLint config in client package (#8761)

This commit is contained in:
Andreas Nedbal 2022-05-30 04:37:34 +02:00 committed by GitHub
parent ebc2566130
commit 3905185463
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 59 additions and 47 deletions

View File

@ -1,68 +1,79 @@
module.exports = { module.exports = {
root: true, root: true,
env: { env: {
"node": false 'node': false,
}, },
parser: "vue-eslint-parser", parser: 'vue-eslint-parser',
parserOptions: { parserOptions: {
"parser": "@typescript-eslint/parser", 'parser': '@typescript-eslint/parser',
tsconfigRootDir: __dirname, tsconfigRootDir: __dirname,
//project: ['./tsconfig.json'], project: ['./tsconfig.json'],
extraFileExtensions: ['.vue'],
}, },
extends: [ extends: [
//"../shared/.eslintrc.js", '../shared/.eslintrc.js',
"plugin:vue/vue3-recommended" 'plugin:vue/vue3-recommended',
], ],
rules: { rules: {
// window の禁止理由: グローバルスコープと衝突し、予期せぬ結果を招くため // window の禁止理由: グローバルスコープと衝突し、予期せぬ結果を招くため
// data の禁止理由: 抽象的すぎるため // data の禁止理由: 抽象的すぎるため
// e の禁止理由: error や event など、複数のキーワードの頭文字であり分かりにくいため // e の禁止理由: error や event など、複数のキーワードの頭文字であり分かりにくいため
"id-denylist": ["error", "window", "data", "e"], 'id-denylist': ['error', 'window', 'data', 'e'],
'eqeqeq': ['error', 'always', { 'null': 'ignore' }], 'eqeqeq': ['error', 'always', { 'null': 'ignore' }],
"no-shadow": ["warn"], 'no-shadow': ['warn'],
"vue/attributes-order": ["error", { 'vue/attributes-order': ['error', {
"alphabetical": false 'alphabetical': false,
}], }],
"vue/no-use-v-if-with-v-for": ["error", { 'vue/no-use-v-if-with-v-for': ['error', {
"allowUsingIterationVar": false 'allowUsingIterationVar': false,
}], }],
"vue/no-ref-as-operand": "error", 'vue/no-ref-as-operand': 'error',
"vue/no-multi-spaces": ["error", { 'vue/no-multi-spaces': ['error', {
"ignoreProperties": false 'ignoreProperties': false,
}], }],
"vue/no-v-html": "error", 'vue/no-v-html': 'error',
"vue/order-in-components": "error", 'vue/order-in-components': 'error',
"vue/html-indent": ["warn", "tab", { 'vue/html-indent': ['warn', 'tab', {
"attribute": 1, 'attribute': 1,
"baseIndent": 0, 'baseIndent': 0,
"closeBracket": 0, 'closeBracket': 0,
"alignAttributesVertically": true, 'alignAttributesVertically': true,
"ignores": [] 'ignores': [],
}], }],
"vue/html-closing-bracket-spacing": ["warn", { 'vue/html-closing-bracket-spacing': ['warn', {
"startTag": "never", 'startTag': 'never',
"endTag": "never", 'endTag': 'never',
"selfClosingTag": "never" 'selfClosingTag': 'never',
}], }],
"vue/multi-word-component-names": "warn", 'vue/multi-word-component-names': 'warn',
"vue/require-v-for-key": "warn", 'vue/require-v-for-key': 'warn',
"vue/no-unused-components": "warn", 'vue/no-unused-components': 'warn',
"vue/valid-v-for": "warn", 'vue/valid-v-for': 'warn',
"vue/return-in-computed-property": "warn", 'vue/return-in-computed-property': 'warn',
"vue/no-setup-props-destructure": "warn", 'vue/no-setup-props-destructure': 'warn',
"vue/max-attributes-per-line": "off", 'vue/max-attributes-per-line': 'off',
"vue/html-self-closing": "off", 'vue/html-self-closing': 'off',
"vue/singleline-html-element-content-newline": "off", 'vue/singleline-html-element-content-newline': 'off',
}, },
globals: { globals: {
"require": false, // Node.js
"_DEV_": false, 'module': false,
"_LANGS_": false, 'require': false,
"_VERSION_": false, '__dirname': false,
"_ENV_": false,
"_PERF_PREFIX_": false, // Vue
"_DATA_TRANSFER_DRIVE_FILE_": false, '$$': false,
"_DATA_TRANSFER_DRIVE_FOLDER_": false, '$ref': false,
"_DATA_TRANSFER_DECK_COLUMN_": false '$computed': false,
}
} // Misskey
'_DEV_': false,
'_LANGS_': false,
'_VERSION_': false,
'_ENV_': false,
'_PERF_PREFIX_': false,
'_DATA_TRANSFER_DRIVE_FILE_': false,
'_DATA_TRANSFER_DRIVE_FOLDER_': false,
'_DATA_TRANSFER_DECK_COLUMN_': false,
},
};

View File

@ -39,6 +39,7 @@
}, },
"compileOnSave": false, "compileOnSave": false,
"include": [ "include": [
".eslintrc.js",
"./**/*.ts", "./**/*.ts",
"./**/*.vue" "./**/*.vue"
] ]