-
Notifications
You must be signed in to change notification settings - Fork 140
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Draft - Proposal for code linting (#3839)
* Add eslint config, stylelint and prettier * Remove .vscode from gitignore, add missing linters * Finish configuring linters * Undo accidental Dockerfile change * simplified Dockerfile to not use nvm * Fix eslint matches path * Tweak linting * remove newline * Fix format command usages * Fix broken eslint-disable line * update a few settings, add json linting * revert Dockerfile changes * add gear schema * update .nvmrc --------- Co-authored-by: Kayla Glick <[email protected]>
- Loading branch information
1 parent
af7da84
commit aa19e1c
Showing
22 changed files
with
6,175 additions
and
248 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# top-most EditorConfig file | ||
root = true | ||
|
||
# Unix-style newlines with a newline ending every file | ||
[*] | ||
indent_style = tab | ||
tab_width = 4 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ui/core/proto/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,52 @@ | ||
module.exports = { | ||
"parser": "@typescript-eslint/parser", | ||
"plugins": [ | ||
"@typescript-eslint", | ||
"unused-imports" | ||
root: true, | ||
parser: '@typescript-eslint/parser', | ||
plugins: ['simple-import-sort'], | ||
extends: [ | ||
'plugin:json/recommended', | ||
'plugin:import/errors', | ||
'plugin:import/warnings', | ||
'plugin:import/typescript', | ||
'plugin:@typescript-eslint/eslint-recommended', | ||
'plugin:@typescript-eslint/recommended', | ||
'plugin:prettier/recommended', | ||
], | ||
"env": { | ||
"browser": true, | ||
"es6": true, | ||
"node": true | ||
env: { | ||
es6: true, | ||
browser: true, | ||
}, | ||
"globals": { | ||
"Atomics": "readonly", | ||
"SharedArrayBuffer": "readonly" | ||
parserOptions: { | ||
ecmaVersion: 2021, | ||
sourceType: 'module', | ||
ecmaFeatures: { | ||
jsx: true, | ||
}, | ||
}, | ||
"parserOptions": { | ||
"ecmaVersion": 2018, | ||
"sourceType": "module" | ||
}, | ||
"rules": { | ||
"@typescript-eslint/no-unused-vars": "off", | ||
"unused-imports/no-unused-imports": "error", | ||
"unused-imports/no-unused-vars": [ | ||
"error", | ||
{ "vars": "all", "varsIgnorePattern": "^_", "args": "after-used", "argsIgnorePattern": "^_" } | ||
rules: { | ||
'@typescript-eslint/member-delimiter-style': 'off', | ||
'@typescript-eslint/explicit-function-return-type': 'off', | ||
'@typescript-eslint/explicit-module-boundary-types': 'off', | ||
'@typescript-eslint/no-non-null-assertion': 'off', | ||
'@typescript-eslint/no-explicit-any': 'off', | ||
'@typescript-eslint/no-use-before-define': 'off', | ||
'@typescript-eslint/indent': 'off', | ||
'@typescript-eslint/no-unused-vars': [ | ||
'warn', | ||
{ | ||
argsIgnorePattern: '^_', | ||
varsIgnorePattern: '^_', | ||
}, | ||
], | ||
'@typescript-eslint/no-object-literal-type-assertion': 'off', | ||
'@typescript-eslint/explicit-member-accessibility': 'off', | ||
'@typescript-eslint/camelcase': 'off', | ||
'@typescript-eslint/no-empty-interface': 'off', | ||
'@typescript-eslint/ban-ts-comment': 'off', | ||
'prettier/prettier': 'off', | ||
'import/no-unresolved': 'off', | ||
'simple-import-sort/imports': 'warn', | ||
'import/named': 'off', | ||
'import/namespace': 'off', | ||
'arrow-parens': ['error', 'as-needed'], | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
19.8.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/** | ||
* @type {import("prettier").Options)} | ||
*/ | ||
module.exports = { | ||
printWidth: 100, | ||
useTabs: true, | ||
tabWidth: 4, | ||
semi: true, | ||
singleQuote: true, | ||
trailingComma: 'all', | ||
bracketSpacing: true, | ||
bracketSameLine: true, | ||
arrowParens: 'avoid', | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"recommendations": [ | ||
"dbaeumer.vscode-eslint", | ||
"esbenp.prettier-vscode", | ||
"stylelint.vscode-stylelint", | ||
"visualstudioexptteam.vscodeintellicode", | ||
"editorconfig.editorconfig" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,23 @@ | ||
# syntax=docker/dockerfile:1 | ||
|
||
FROM golang:1.21 | ||
|
||
WORKDIR /wotlk | ||
COPY . . | ||
COPY gitconfig /etc/gitconfig | ||
|
||
RUN apt-get update | ||
RUN apt-get install -y protobuf-compiler | ||
RUN go get -u google.golang.org/protobuf | ||
RUN go install google.golang.org/protobuf/cmd/protoc-gen-go@latest | ||
|
||
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash | ||
|
||
ENV NODE_VERSION=19.8.0 | ||
ENV NVM_DIR="/root/.nvm" | ||
RUN . "$NVM_DIR/nvm.sh" && nvm install ${NODE_VERSION} | ||
RUN . "$NVM_DIR/nvm.sh" && nvm use v${NODE_VERSION} | ||
RUN . "$NVM_DIR/nvm.sh" && nvm alias default v${NODE_VERSION} | ||
ENV PATH="/root/.nvm/versions/node/v${NODE_VERSION}/bin/:${PATH}" | ||
|
||
EXPOSE 8080/tcp | ||
# syntax=docker/dockerfile:1 | ||
|
||
FROM golang:1.21 | ||
|
||
WORKDIR /wotlk | ||
COPY . . | ||
COPY gitconfig /etc/gitconfig | ||
|
||
RUN apt-get update | ||
RUN apt-get install -y protobuf-compiler | ||
RUN go get -u google.golang.org/protobuf | ||
RUN go install google.golang.org/protobuf/cmd/protoc-gen-go@latest | ||
|
||
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash | ||
|
||
ENV NODE_VERSION=19.8.0 | ||
ENV NVM_DIR="/root/.nvm" | ||
RUN . "$NVM_DIR/nvm.sh" && nvm install ${NODE_VERSION} | ||
RUN . "$NVM_DIR/nvm.sh" && nvm use v${NODE_VERSION} | ||
RUN . "$NVM_DIR/nvm.sh" && nvm alias default v${NODE_VERSION} | ||
ENV PATH="/root/.nvm/versions/node/v${NODE_VERSION}/bin/:${PATH}" | ||
|
||
EXPOSE 8080/tcp |
Oops, something went wrong.