From a3500c453b8ca57a64dbbfb8dc28a1cb45b3e71d Mon Sep 17 00:00:00 2001 From: Michel Weststrate Date: Fri, 24 Dec 2021 07:15:15 -0800 Subject: [PATCH] Fix linter / prettier not working when using `sonar` as VS Code workspace Summary: Per title Reviewed By: antonk52 Differential Revision: D33308303 fbshipit-source-id: b4786fe8070b12ae211b68aafdc32814ea53381e --- .vscode/settings.json | 2 +- desktop/.eslintrc.js | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index e46398291..21592c163 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -5,7 +5,7 @@ "eslint.packageManager": "yarn", "eslint.codeActionsOnSave.mode": "all", "editor.formatOnSave": true, - "files.trimTrailingWhitespace": false, // This one is broken as it cleans string literals as well, killing Jest snapshots: https://github.com/Microsoft/vscode/issues/52711 + "files.trimTrailingWhitespace": false, "prettier.formatAlreadyFormattedFilesOnSave": false, "files.eol": "\n", "editor.codeActionsOnSave": { diff --git a/desktop/.eslintrc.js b/desktop/.eslintrc.js index 117c54ea9..fbf733802 100644 --- a/desktop/.eslintrc.js +++ b/desktop/.eslintrc.js @@ -7,10 +7,12 @@ * @format */ +const path = require('path'); + const fbjs = require('eslint-config-fbjs'); const rulesDirPlugin = require('eslint-plugin-rulesdir'); -rulesDirPlugin.RULES_DIR = 'eslint-rules'; +rulesDirPlugin.RULES_DIR = path.join(__dirname, 'eslint-rules'); // enforces copy-right header and @format directive to be present in every file const pattern = /^\*\r?\n[\S\s]*Facebook[\S\s]* \* @format\r?\n/;