Fix web lint errors and enable web linting in CI (#72)

This commit is contained in:
Keavon Chambers 2021-04-14 00:41:20 -07:00 committed by GitHub
parent 1fd298cf9e
commit e3be55d4e2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 19 additions and 6 deletions

View file

@ -28,6 +28,9 @@ jobs:
- name: 👷 Build Graphite web client
run: cd client/web && npm run build
- name: 👕 Lint Graphite web formatting
run: cd client/web && npm run lint
- name: 🔬 Check Rust formatting
run: cargo fmt --all -- --check

View file

@ -11,6 +11,15 @@ module.exports = {
parserOptions: {
ecmaVersion: 2020,
},
settings: {
"import/resolver": {
// `node` must be the top property
node: {},
webpack: {
config: require.resolve("@vue/cli-service/webpack.config.js"),
},
},
},
rules: {
"no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
"no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
@ -19,7 +28,8 @@ module.exports = {
"linebreak-style": ["error", "unix"],
indent: ["error", "tab"],
quotes: ["error", "double"],
camelcase: ["warn", { ignoreImports: true, ignoreDestructuring: true }],
"@typescript-eslint/camelcase": "off",
camelcase: ["error", { ignoreImports: true, ignoreDestructuring: true }],
"import/extensions": ["error", "ignorePackages", {
js: "never", jsx: "never", ts: "never", tsx: "never",
}],

View file

@ -24,8 +24,7 @@ export function handleResponse(responseType: ResponseType, responseData: string)
if (callback) {
callback(responseData);
}
else {
} else {
console.error(`Received a Response of type "${responseType}" but no handler was registered for it from the client.`);
}
}

View file

@ -1,11 +1,12 @@
declare module "*.vue" {
import type { DefineComponent } from "vue"
const component: DefineComponent<{}, {}, any>;
import type { DefineComponent, DefineComponent } from "vue";
const component: DefineComponent;
export default component;
}
declare module "*.svg" {
import type { DefineComponent } from "vue";
const component: DefineComponent;
export default component;
}