diff --git a/.eslintrc.json b/.eslintrc.json index 4c850713de..4aaa4b55d1 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -21,7 +21,6 @@ "parserOptions": { "ecmaVersion": "latest", "sourceType": "module", - // "project": ["tsconfig.base.json"] "project": true }, "rules": { diff --git a/.lintstagedrc.mjs b/.lintstagedrc.mjs new file mode 100644 index 0000000000..edf3080806 --- /dev/null +++ b/.lintstagedrc.mjs @@ -0,0 +1,14 @@ +import micromatch from 'micromatch'; + +const eslintIgnoredFiles = ['**/global-wallets-env.d.ts']; + +export default { + '*.{ts,tsx}': (files) => { + const match = micromatch.not(files, eslintIgnoredFiles); + return `eslint --fix --quiet ${match.join(' ')}`; + }, + + '*.{ts,tsx,json}': (files) => { + return `prettier --write ${files.join(' ')}`; + }, +}; diff --git a/package.json b/package.json index 3e14df0ae2..fd5615084b 100644 --- a/package.json +++ b/package.json @@ -101,13 +101,5 @@ }, "resolutions": { "react-refresh": "0.9.0" - }, - "lint-staged": { - "*.{ts,tsx}": [ - "eslint --fix --quiet" - ], - "*.{ts,tsx,json}": [ - "prettier --write" - ] } }