Skip to content

Commit

Permalink
Finish svelte migration (viamrobotics#2522)
Browse files Browse the repository at this point in the history
  • Loading branch information
micheal-parks authored Jun 16, 2023
1 parent 3aebd3d commit 51ceb9b
Show file tree
Hide file tree
Showing 37 changed files with 1,332 additions and 8,411 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ lint-go: tool-install
export pkgs="`go list -f '{{.Dir}}' ./... | grep -v /proto/`" && echo "$$pkgs" | xargs go vet -vettool=$(TOOL_BIN)/combined
GOGC=50 $(TOOL_BIN)/golangci-lint run -v --fix --config=./etc/.golangci.yaml

lint-web: typecheck-web
lint-web: check-web
npm run lint --prefix web/frontend

typecheck-web:
npm run typecheck --prefix web/frontend
check-web:
npm run check --prefix web/frontend

cover: tool-install
PATH=$(PATH_WITH_TOOLS) ./etc/test.sh cover-with-race
Expand Down
32 changes: 5 additions & 27 deletions web/frontend/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
module.exports = {
root: true,
env: {
browser: true,
es2021: true,
node: true,
},
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: './tsconfig.json',
extraFileExtensions: ['.svelte', '.vue'],
extraFileExtensions: ['.svelte'],
tsconfigRootDir: __dirname,
},
plugins: [
'vue',
'@typescript-eslint',
'unicorn',
'tailwindcss',
Expand All @@ -25,9 +25,6 @@ module.exports = {
'eslint:all',
'plugin:unicorn/recommended',
'plugin:tailwindcss/recommended',
'plugin:vue/vue3-essential',
'plugin:vue/vue3-strongly-recommended',
'plugin:vue/vue3-recommended',
'plugin:svelte/recommended',
'plugin:svelte/prettier',
'plugin:promise/recommended',
Expand All @@ -43,16 +40,10 @@ module.exports = {
parserOptions: {
parser: '@typescript-eslint/parser',
},
}, {
files: ['*.vue'],
parser: 'vue-eslint-parser',
parserOptions: {
parser: '@typescript-eslint/parser',
},
}
],
settings: {
'import/extensions': ['.vue'],
'import/extensions': ['.svelte'],
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.js'],
},
Expand All @@ -65,7 +56,7 @@ module.exports = {
alias: {
'@': './frontend/src',
},
extensions: ['.ts', '.js', '.vue'],
extensions: ['.ts', '.js', '.svelte'],
},
},
},
Expand Down Expand Up @@ -133,7 +124,6 @@ module.exports = {
// Eventually we want to re-enable, so that people comment jira tickets instead of TODO.
'no-warning-comments': 'off',
'padded-blocks': 'off',
'vue/no-deprecated-slot-attribute': 'off',
quotes: ['error', 'single', { avoidEscape: true }],
semi: ['error', 'always'],
'comma-dangle': [
Expand All @@ -147,12 +137,6 @@ module.exports = {
},
],

/**
* Typescript catches these issues, and ESLint isn't smart enough to understand
* Vue's macros like 'defineProps()', so we'll turn these off for now
*/
'no-undef': 'off',
'no-unused-vars': 'off',
'quote-props': ['error', 'as-needed'],
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
Expand Down Expand Up @@ -183,12 +167,6 @@ module.exports = {
'prefer-arrow-callback': 'error',
'prefer-const': 'error',

// Vue
'vue/multi-word-component-names': 'off',
'vue/no-undef-components': ['error', { ignorePatterns: ['-'] }],
'vue/require-default-prop': 'off',
'vue/attribute-hyphenation': 'off',

// Unicorn
'unicorn/no-empty-file': 'off',
'unicorn/no-unsafe-regex': 'error',
Expand Down
Loading

0 comments on commit 51ceb9b

Please sign in to comment.