Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(maint) Set syntax and format style guidelines #745

Merged
merged 1 commit into from
Aug 31, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org

root = true

[*]
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 2

[*.{diff,md}]
trim_trailing_whitespace = false
4 changes: 3 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
node_modules
out
out
src/test
testFixture
9 changes: 5 additions & 4 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
{
"env": { "browser": true, "es6": true, "node": true },
"root": true,
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint"
],
"plugins": ["@typescript-eslint", "prettier"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended"
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended",
"prettier"
]
}
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
* text=auto
* text eol=lf
# special shasum test can't have linefeeds change
# https://github.com/actions/checkout/issues/226
shasumtest.txt text eol=lf
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
snippets
syntaxes
out
package-lock.json
9 changes: 9 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"endOfLine": "lf",
"printWidth": 120,
"semi": true,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "all",
"useTabs": false
}
6 changes: 6 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"recommendations": [
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
]
}
46 changes: 43 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,45 @@
{
"editor.insertSpaces": false,
"typescript.preferences.quoteStyle": "single",
"typescript.tsc.autoDetect": "off"
"editor.insertSpaces": true,
"editor.tabSize": 2,

"files.encoding": "utf8",
"files.eol": "\n",
"files.insertFinalNewline": true,
"files.trimFinalNewlines": true,
"files.trimTrailingWhitespace": true,

"files.exclude": {
"node_modules": true,
"out": true
},
"search.exclude": {
"node_modules": true,
"out": true
},

"typescript.format.enable": false,
"typescript.tsc.autoDetect": "off",

"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[jsonc]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[markdown]": {
"editor.wordWrapColumn": 80,
"editor.wordWrap": "wordWrapColumn",
"editor.quickSuggestions": false,
"files.trimTrailingWhitespace": false
},
"[typescript]": {
"editor.codeActionsOnSave": {
"source.fixAll": true,
"source.organizeImports": true
},
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
}
105 changes: 104 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@
"package": "vsce package",
"compile": "tsc -b",
"watch": "tsc -b -w",
"lint": "eslint .",
"lint": "eslint src/**/*.ts",
"test-compile": "tsc -p ./",
"test": "npm run test-compile && node ./out/test/runTest.js"
},
Expand All @@ -245,9 +245,12 @@
"@types/yauzl": "^2.9.1",
"@typescript-eslint/eslint-plugin": "^3.9.0",
"@typescript-eslint/parser": "^3.9.0",
"eslint": "^7.6.0",
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^3.4.1",
"glob": "^7.1.6",
"mocha": "^8.2.1",
"prettier": "^2.3.2",
"typescript": "^3.9.7",
"vsce": "^1.93.0",
"vscode-test": "^1.5.2"
Expand Down