config: use ignore files to completely define file patterns for eslint and prettier (instead of in the command)

This commit is contained in:
Xymorot 2020-02-03 22:38:25 +01:00
parent 39af36bf52
commit 598f0d4888
3 changed files with 45 additions and 9 deletions

View File

@ -1,6 +1,18 @@
# ignore every file
*.*
# except these file types
!*.js
!*.ts
# but ignore stuff from .gitignore
node_modules
src/**/*.js
tests/**/*.js
mocks/**/*.js
frontend
out
.nyc_output
/src/**/*.js
/tests/**/*.js
/mocks/**/*.js
/frontend
/store-backup
/test-paths
/store
/out

24
.prettierignore Normal file
View File

@ -0,0 +1,24 @@
# ignore every file
*.*
# except these file types
!*.html
!*.handlebars
!*.json
!*.yml
!*.svelte
!*.md
!*.ts
!*.js
# but ignore stuff from .gitignore
node_modules
.nyc_output
/src/**/*.js
/tests/**/*.js
/mocks/**/*.js
/frontend
/store-backup
/test-paths
/store
/out

View File

@ -36,10 +36,10 @@
"coverage:fast": "nyc npm run test:fast",
"coverage": "nyc npm run test",
"prelint": "eslint --print-config forge.config.js | eslint-config-prettier-check",
"lint": "eslint ./**/*.{js,ts} --max-warnings 1",
"lint:fix": "eslint . --fix",
"prettier": "prettier --ignore-path .gitignore -c **/*.{html,handlebars,json,{c,sc,sa,le}ss,yml,svelte,md,ts,js}",
"prettier:fix": "prettier --ignore-path .gitignore --write **/*.{html,handlebars,json,{c,sc,sa,le}ss,yml,svelte,md,ts,js}",
"lint": "eslint ./**/*.* --max-warnings 1",
"lint:fix": "eslint ./**/*.* --fix",
"prettier": "prettier -c **/*.*",
"prettier:fix": "prettier --write **/*.*",
"fix": "npm run lint:check && npm run lint:fix && npm run prettier:fix",
"forge:make": "electron-forge --platform win32 --arch x64 make",
"forge": "npm audit && npm run build && npm run forge:make",