Skip to content

Commit

Permalink
satellite/admin/back-office/ui: lint files
Browse files Browse the repository at this point in the history
This change lints files for the new satellite admin web app. An
ESLint config has been added for it that is identical to the one used
for linting satellite web app files.

Change-Id: I66f72fb880d5cbc80b6c080294e4a830b3d28143
  • Loading branch information
jewharton authored and Storj Robot committed Oct 27, 2023
1 parent 2772483 commit 8ebf285
Show file tree
Hide file tree
Showing 71 changed files with 8,292 additions and 4,841 deletions.
108 changes: 108 additions & 0 deletions satellite/admin/back-office/ui/.eslintrc.js
@@ -0,0 +1,108 @@
// Copyright (C) 2023 Storj Labs, Inc.
// See LICENSE for copying information.

module.exports = {
root: true,
env: {
node: true,
},
extends: [
'plugin:vue/recommended',
'eslint:recommended',
'@vue/eslint-config-typescript/recommended',
'plugin:import/recommended',
'plugin:import/typescript',
],
parser: 'vue-eslint-parser',
parserOptions: {
parser: '@typescript-eslint/parser',
sourceType: 'module',
ecmaVersion: 2020,
},
plugins: ['eslint-plugin-import'],
rules: {
'linebreak-style': ['error', 'unix'],

'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',

'no-tabs': 'warn',
'indent': ['warn', 4],
'vue/html-indent': ['warn', 4],

'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-var-requires': 'off',

'no-multiple-empty-lines': ['error', { 'max': 1 }],

'import/order': ['error', {
'pathGroups': [
{
'group': 'internal',
'pattern': '@/{components,views}/**',
'position': 'after',
},
{
'group': 'internal',
'pattern': '@/assets/**',
'position': 'after',
},
],
'newlines-between': 'always',
}],
'no-duplicate-imports': 'error',
'import/default': 'off',
'vue/script-setup-uses-vars': 'error',
'object-curly-spacing': ['error', 'always'],
'quotes': ['error', 'single', { 'allowTemplateLiterals': true }],
'semi': ['error', 'always'],
'keyword-spacing': ['error'],
'comma-dangle': ['error', 'always-multiline'],
'no-trailing-spaces': ['error'],
'eqeqeq': ['error'],
'comma-spacing': ['error'],
'arrow-spacing': ['error'],
'space-in-parens': ['error'],
'space-before-blocks': ['error'],

'vue/multi-word-component-names': ['off'],
'vue/max-attributes-per-line': ['off'],
'vue/singleline-html-element-content-newline': ['off'],

'vue/block-lang': ['error', { 'script': { 'lang': 'ts' } }],
'vue/html-button-has-type': ['error'],
'vue/no-unused-properties': ['warn'],
'vue/no-unused-refs': ['warn'],
'vue/no-unused-vars': ['warn'],
'vue/no-useless-v-bind': ['warn'],
'vue/no-v-model-argument': ['off'],
'vue/valid-v-slot': ['error', { 'allowModifiers': true }],

'vue/no-useless-template-attributes': ['off'], // TODO: fix later
'vue/no-multiple-template-root': ['off'], // it's possible to have multiple roots in template in Vue 3

'vue/no-undef-components': ['warn', { ignorePatterns: ['router-link', 'router-view'] }],

'vue/no-v-html': ['error'],
},
settings: {
'import/resolver': {
'eslint-import-resolver-custom-alias': {
'alias': {
'@': './src',
},
extensions: ['.ts', '.vue'],
},
typescript: {
alwaysTryTypes: true,
project: './tsconfig.json',
},
node: true,
},
'import/parsers': {
'@typescript-eslint/parser': ['.ts'],
'vue-eslint-parser': ['.vue'],
},
},
};
2 changes: 1 addition & 1 deletion satellite/admin/back-office/ui/index.html
Expand Up @@ -10,7 +10,7 @@

<body>
<div id="app"></div>
<script type="module" src="/src/main.js"></script>
<script type="module" src="/src/main.ts"></script>
</body>

</html>

0 comments on commit 8ebf285

Please sign in to comment.