Skip to content

Commit

Permalink
formatting setup
Browse files Browse the repository at this point in the history
* add pre-commit hooks to lint stage files
* prettier setup
* eslint setup
  • Loading branch information
chmelevskij committed Jan 1, 2023
1 parent b287361 commit e4f2a86
Show file tree
Hide file tree
Showing 9 changed files with 501 additions and 223 deletions.
16 changes: 9 additions & 7 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module.exports = {
ecmaVersion: 2020,
sourceType: "module",
},
extends: ["plugin:vue/recommended"],
extends: ["plugin:vue/recommended", "prettier"],
env: {
node: true,
jquery: true,
Expand All @@ -12,13 +12,15 @@ module.exports = {
webextensions: true,
},
rules: {
"no-trailing-spaces": "error",
"eol-last": "error",
semi: "error",
"no-extra-semi": "error",
"comma-dangle": ["error", "always-multiline"],
"no-var": "error",
"prefer-template": "error",
"template-curly-spacing": "error",
"comma-dangle": ["error", "always-multiline"],
indent: [
"error",
4,
{
SwitchCase: 1,
},
],
},
};
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ cordova/bundle.keystore
.DS_store

# artefacts for Visual Studio Code
/.vscode/
.vscode/*
!.vscode/extensions.json

# NetBeans
nbproject/
Expand Down
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx lint-staged
3 changes: 3 additions & 0 deletions .lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"**/*": ["prettier --write --ignore-unknown", "eslint --fix"]
}
34 changes: 34 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# node.js npm related

node_modules/
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Configurator Build process
cache/
apps/
dist/
dist_cordova/
debug/
release/
testresults/
.eslintcache
cordova/bundle.keystore

# OSX
.DS_store

# artefacts for Visual Studio Code
/.vscode/

# NetBeans
nbproject/

# IntelliJ
.idea

# Eclipse
.project
.settings/
test-results-junit/
1 change: 1 addition & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
5 changes: 5 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"recommendations": [
"esbenp.prettier-vscode"
]
}
Loading

0 comments on commit e4f2a86

Please sign in to comment.