From 638858b2ee797c19de8e2c75f589be3e380da340 Mon Sep 17 00:00:00 2001 From: Howard Braham Date: Tue, 18 Jul 2023 10:24:24 -0700 Subject: [PATCH] fix(lint): Change endOfLine rules to better support linting on Windows --- .eslintrc.base.js | 3 +++ .prettierrc.yml | 3 +++ package.json | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.eslintrc.base.js b/.eslintrc.base.js index b4e93c1c9591..c13c95352294 100644 --- a/.eslintrc.base.js +++ b/.eslintrc.base.js @@ -72,5 +72,8 @@ module.exports = { // upgrading eslint and dependencies. This rule should be evaluated and // if agreeable turned on upstream in @metamask/eslint-config 'import/no-named-as-default-member': 'off', + + // This is necessary to run eslint on Windows and not get a thousand CRLF errors + 'prettier/prettier': ['error', { endOfLine: 'auto' }], }, }; diff --git a/.prettierrc.yml b/.prettierrc.yml index 3e9d085ced2e..9912c96b0bab 100644 --- a/.prettierrc.yml +++ b/.prettierrc.yml @@ -1,2 +1,5 @@ +# All of these are defaults except singleQuote and endOfLine, but we specify them +# for explicitness +endOfLine: auto singleQuote: true trailingComma: all diff --git a/package.json b/package.json index 59b5523bb443..8bcd07da9920 100644 --- a/package.json +++ b/package.json @@ -63,7 +63,7 @@ "lint:lockfile:dedupe:fix": "yarn dedupe", "lint:lockfile": "lockfile-lint --path yarn.lock --allowed-hosts npm yarn github.com codeload.github.com --empty-hostname true --allowed-schemes \"https:\" \"git+https:\" \"npm:\" \"patch:\" \"workspace:\"", "lint:shellcheck": "./development/shellcheck.sh", - "lint:styles": "stylelint -- */**/*.scss", + "lint:styles": "stylelint '*/**/*.scss'", "lint:styles:fix": "yarn lint:styles --fix", "lint:tsc": "tsc --project tsconfig.json --noEmit", "validate-source-maps": "node ./development/sourcemap-validator.js",