From 598f0d48889995a4de318555280841a2d4cbacb3 Mon Sep 17 00:00:00 2001 From: Xymorot Date: Mon, 3 Feb 2020 22:38:25 +0100 Subject: [PATCH] config: use ignore files to completely define file patterns for eslint and prettier (instead of in the command) --- .eslintignore | 22 +++++++++++++++++----- .prettierignore | 24 ++++++++++++++++++++++++ package.json | 8 ++++---- 3 files changed, 45 insertions(+), 9 deletions(-) create mode 100644 .prettierignore diff --git a/.eslintignore b/.eslintignore index 876e98c..b569757 100644 --- a/.eslintignore +++ b/.eslintignore @@ -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 diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..4e864f7 --- /dev/null +++ b/.prettierignore @@ -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 diff --git a/package.json b/package.json index ce47ba2..6fcca1d 100644 --- a/package.json +++ b/package.json @@ -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",