Skip to content

Commit

Permalink
chore: integrate eslint, prettier, husky, lint-staged
Browse files Browse the repository at this point in the history
  • Loading branch information
phts committed Jan 29, 2024
1 parent ee0c50b commit 81bb5f9
Show file tree
Hide file tree
Showing 10 changed files with 4,677 additions and 3 deletions.
13 changes: 13 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# disabled for all by default
*
!.*.js

# enabled for spotify only
!/spotify/
!/spotify/**/
!/spotify/**/*

# add more exceptions to enable for other plugins
# ...

node_modules/
30 changes: 30 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"extends": ["eslint:recommended", "plugin:prettier/recommended"],
"parser": "@babel/eslint-parser",
"parserOptions": {
"requireConfigFile": false
},
"env": {
"es6": true,
"node": true
},
"rules": {
"camelcase": [
"warn",
{ "properties": "never", "ignoreDestructuring": true, "ignoreImports": true, "ignoreGlobals": true }
],
"eqeqeq": "warn",
"new-cap": "warn",
"no-async-promise-executor": "off",
"no-console": "off",
"no-constant-condition": "off",
"no-path-concat": "warn",
"no-prototype-builtins": "off",
"no-redeclare": "warn",
"no-use-before-define": "off",
"no-sequences": "error",
"no-unused-vars": "warn",
"no-var": "warn",
"strict": "off"
}
}
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
install.sh text=auto eol=lf
uninstall.sh text=auto eol=lf
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
.idea/
node_modules/

.DS_Store
*node_modules*
.gitignore
/.idea/*
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
4 changes: 4 additions & 0 deletions .lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"*.js": "eslint --fix",
"*.{json,md}": "prettier --write"
}
13 changes: 13 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# disabled for all by default
*
!.*.*

# enabled for spotify only
!/spotify/
!/spotify/**/
!/spotify/**/*

# add more exceptions to enable for other plugins
# ...

node_modules/
5 changes: 5 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"endOfLine": "auto",
"printWidth": 120,
"singleQuote": true
}
Loading

0 comments on commit 81bb5f9

Please sign in to comment.