From a3fa2d46036d8b76b727fbb99a99d6ea8ad4eb1b Mon Sep 17 00:00:00 2001 From: what1s1ove Date: Mon, 20 Nov 2023 21:04:39 +0200 Subject: [PATCH] chore: replace lint-staged yml config with js wd-157 --- .eslintrc.yml | 1 + .lintstagedrc.yml | 4 ---- lint-staged.config.js | 9 +++++++++ package-lock.json | 7 +++++++ package.json | 1 + 5 files changed, 18 insertions(+), 4 deletions(-) delete mode 100644 .lintstagedrc.yml create mode 100644 lint-staged.config.js diff --git a/.eslintrc.yml b/.eslintrc.yml index 187159f9..6e730b48 100644 --- a/.eslintrc.yml +++ b/.eslintrc.yml @@ -135,6 +135,7 @@ overrides: - files: - commitlint.config.js - prettier.config.js + - lint-staged.config.js rules: import/no-default-export: - off diff --git a/.lintstagedrc.yml b/.lintstagedrc.yml deleted file mode 100644 index b88b5c91..00000000 --- a/.lintstagedrc.yml +++ /dev/null @@ -1,4 +0,0 @@ -'*.{json,yml,css,js,cjs,d.ts}': prettier --write -'*': make lint_editor lint_fs -'*.css': make lint_css -'*.js': make lint_js lint_type diff --git a/lint-staged.config.js b/lint-staged.config.js new file mode 100644 index 00000000..16244e13 --- /dev/null +++ b/lint-staged.config.js @@ -0,0 +1,9 @@ +/** @type {import('lint-staged').Config} */ +let config = { + '*': `make lint_editor lint_fs`, + '*.{json,yml,css,js,cjs,d.ts}': `prettier --write`, + '*.css': `make lint_css`, + '*.js': `make lint_js lint_type`, +} + +export default config diff --git a/package-lock.json b/package-lock.json index f97ab26a..198a6a90 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,6 +14,7 @@ "@commitlint/cli": "17.8.1", "@commitlint/config-conventional": "18.4.0", "@ls-lint/ls-lint": "2.2.2", + "@types/lint-staged": "13.2.2", "browserslist": "4.22.1", "concurrently": "8.2.2", "editorconfig-checker": "5.1.1", @@ -1648,6 +1649,12 @@ "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", "dev": true }, + "node_modules/@types/lint-staged": { + "version": "13.2.2", + "resolved": "https://registry.npmjs.org/@types/lint-staged/-/lint-staged-13.2.2.tgz", + "integrity": "sha512-9c2ffPMJ1geob6yBmLuxzYye11HzKyA/I4dRZ8NfrPgY6SyzXt2SROD8vB3YjdPZJqqcu3WXsRvrY3PZbb720A==", + "dev": true + }, "node_modules/@types/mdast": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", diff --git a/package.json b/package.json index 5f8eb1fd..7f3c0df5 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "@commitlint/cli": "17.8.1", "@commitlint/config-conventional": "18.4.0", "@ls-lint/ls-lint": "2.2.2", + "@types/lint-staged": "13.2.2", "browserslist": "4.22.1", "concurrently": "8.2.2", "editorconfig-checker": "5.1.1",