Skip to content

Commit

Permalink
refactor: Enable linting (#25)
Browse files Browse the repository at this point in the history
* add eslint config

* fix tabs & double quotes

* Let's be gentle with lint - just warnings is ok

* Enable CI lint

* Ok no brackets in echo command. got it

* eslint spaces not tabs

* add editor config

* lint format fixes

* back to tabs, trying to keep source similar
  • Loading branch information
simondotm authored Feb 11, 2024
1 parent 65fcb9d commit 0f3c9e8
Show file tree
Hide file tree
Showing 19 changed files with 1,606 additions and 1,556 deletions.
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Editor configuration, see http://editorconfig.org
root = true

[*]
charset = utf-8
indent_style = tab
indent_size = 4
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
max_line_length = off
trim_trailing_whitespace = true
38 changes: 38 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"env": {
"browser": true,
"es2021": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest"
},
"plugins": [
"@typescript-eslint"
],
"rules": {
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": ["warn"],
"@typescript-eslint/no-explicit-any": ["warn"],
"indent": [
"error",
"tab"
],
"no-mixed-spaces-and-tabs": [
"warn",
"smart-tabs"
],
"quotes": [
"warn",
"single"
],
"semi": [
"warn",
"always"
]
}
}
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
run: npm run package

- name: Lint
run: echo npm run lint
run: npm run lint

- name: Test
run: echo npm run test
Expand Down
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@
"build:prod": "npm-run-all \"bundle:client -- --minify\" \"bundle:server -- --minify\"",
"watch": "npm-run-all --parallel \"compile -- -w\" \"bundle:client -- --watch\" \"bundle:server -- --watch\"",
"compile-for-tests": "tsc -b -w",
"lint": "eslint ./client/src ./server/src --ext .ts,.tsx",
"lint": "eslint ./src --ext .ts,.tsx",
"package": "vsce package",
"compile:client": "tsc -p ./client",
"watch:client": "tsc -watch -p ./client",
Expand All @@ -166,23 +166,23 @@
"devDependencies": {
"@types/mocha": "^10.0.6",
"@types/node": "^20.10.5",
"@typescript-eslint/eslint-plugin": "^6.14.0",
"@typescript-eslint/parser": "^6.14.0",
"@types/vscode": "^1.85.0",
"@typescript-eslint/eslint-plugin": "^6.21.0",
"@typescript-eslint/parser": "^6.21.0",
"@vscode/test-electron": "^2.3.8",
"@vscode/vsce": "^2.23.0",
"esbuild": "^0.19.11",
"eslint": "^8.56.0",
"mocha": "^10.2.0",
"npm-run-all": "^4.1.5",
"typescript": "^5.3.3",
"ts-mocha": "^10.0.0",
"@types/vscode": "^1.85.0",
"@vscode/test-electron": "^2.3.8"
"typescript": "^5.3.3"
},
"dependencies": {
"source-map-support": "^0.5.21",
"vscode-languageclient": "^9.0.1",
"vscode-languageserver": "^9.0.1",
"vscode-languageserver-textdocument": "^1.0.11",
"vscode-uri": "^3.0.8",
"vscode-languageclient": "^9.0.1"
"vscode-uri": "^3.0.8"
}
}
Loading

0 comments on commit 0f3c9e8

Please sign in to comment.