diff --git a/.lintstagedrc.js b/.lintstagedrc.js index 6c4c202c0..870ebef23 100644 --- a/.lintstagedrc.js +++ b/.lintstagedrc.js @@ -1,78 +1,78 @@ const { CLIEngine } = require('eslint'); const { getClangPaths } = require('./scripts/get_clang_paths'); const { findRustProjectPath } = require('./scripts/get_cargo_path'); const cli = new CLIEngine({}); module.exports = { '*.{js,mjs,cjs}': function eslint(files) { // This logic is likely broken and needs to be updated. see ENG-1011 return ( - 'eslint --cache --fix --max-warnings=0 ' + + 'eslint --cache --fix --report-unused-disable-directives --max-warnings=0 ' + files.filter(file => !cli.isPathIgnored(file)).join(' ') ); }, '*.{css,html,md,json}': function prettier(files) { return 'prettier --write ' + files.join(' '); }, '*.sh': function shellCheck(files) { return 'shellcheck -x -P SCRIPTDIR ' + files.join(' '); }, 'lib/**/*.js': function libFlow(files) { return 'yarn workspace lib flow --quiet'; }, 'lib/**/*.js': function libTest(files) { return 'yarn workspace lib test'; }, '{web,lib}/**/*.js': function webFlow(files) { return 'yarn workspace web flow --quiet'; }, 'web/**/*.js': function webTest(files) { return 'yarn workspace web test'; }, '{native,lib}/**/*.js': function nativeFlow(files) { return 'yarn workspace native flow --quiet'; }, '{native,lib}/**/*.js': function nativeFlow(files) { return 'yarn workspace native test'; }, '{keyserver,web,lib}/**/*.js': function keyserverFlow(files) { return 'yarn workspace keyserver flow --quiet'; }, '{keyserver,web,lib}/**/*.js': function keyserverTest(files) { return 'yarn workspace keyserver test'; }, '{landing,lib}/**/*.js': function landingFlow(files) { return 'yarn workspace landing flow --quiet'; }, '{desktop,lib}/**/*.js': function desktopFlow(files) { return 'yarn workspace desktop flow --quiet'; }, 'services/electron-update-server/**/*.js': function desktopFlow(files) { return 'yarn workspace electron-update-server flow --quiet'; }, 'services/identity/**/*.rs': function testIdentity(files) { return 'bash -c "cd services/identity && cargo test"'; }, '{native,services}/**/*.{h,cpp,java,mm}': function clangFormat(files) { files = files.filter(path => { if (path.indexOf('generated') !== -1) { return false; } for (const allowedPath of getClangPaths()) { if (path.indexOf(allowedPath) !== -1) { return true; } } return false; }); return 'clang-format -i ' + files.join(' '); }, '*.rs': function rustFormat(files) { const paths = new Set(files.map(findRustProjectPath).filter(Boolean)); return `yarn rust-pre-commit ${Array.from(paths).join(' ')}`; }, 'services/terraform/**/*.tf': function checkTerraform(files) { return 'yarn terraform-pre-commit'; }, }; diff --git a/package.json b/package.json index 45609f82e..4a636f6dc 100644 --- a/package.json +++ b/package.json @@ -1,57 +1,57 @@ { "private": true, "license": "BSD-3-Clause", "workspaces": [ "lib", "web", "native", "keyserver", "landing", "desktop", "keyserver/addons/rust-node-addon", "native/expo-modules/comm-expo-package", "services/electron-update-server", "web/opaque-ke-wasm" ], "scripts": { "clean": "yarn workspace lib clean && yarn workspace web clean && yarn workspace native clean && yarn workspace keyserver clean && yarn workspace landing clean && yarn workspace desktop clean && yarn workspace rust-node-addon clean && yarn workspace electron-update-server clean && rm -rf node_modules/", "cleaninstall": "(killall flow || pkill flow || true) && yarn clean && yarn", "ci-cleaninstall": "yarn cleaninstall --frozen-lockfile --skip-optional --network-timeout 180000", - "eslint:all": "eslint .", - "eslint:fix": "eslint --fix .", + "eslint:all": "eslint --report-unused-disable-directives .", + "eslint:fix": "eslint --fix --report-unused-disable-directives .", "clang-format-all": "eval `node scripts/get_clang_paths_cli.js` | xargs clang-format -i", "rust-pre-commit": "./scripts/rust_pre_commit.sh", "terraform-pre-commit": "./scripts/terraform_pre_commit.sh", "prepare": "husky install", "arcpatch": "git pull --all --tags && arc patch", "postinstall": "bash ./postinstall.sh", "flow:all": "yarn workspace lib flow && yarn workspace web flow && yarn workspace landing flow && yarn workspace native flow && yarn workspace keyserver flow && yarn workspace desktop flow && yarn workspace electron-update-server flow", "jest:all": "yarn workspace lib test && yarn workspace keyserver test && yarn workspace web test && yarn workspace native test" }, "devDependencies": { "@babel/eslint-parser": "^7.23.3", "clang-format": "^1.8.0", "core-js": "^3.6.5", "eslint": "^8.56.0", "eslint-config-prettier": "^9.1.0", "eslint-plugin-flowtype": "^8.0.3", "eslint-plugin-import": "^2.29.1", "eslint-plugin-jest": "^27.6.1", "eslint-plugin-monorepo": "^0.3.2", "eslint-plugin-prettier": "^5.1.2", "eslint-plugin-react": "^7.33.2", "eslint-plugin-react-hooks": "^4.6.0", "eslint-plugin-react-native": "^4.1.0", "find-up": "^5.0.0", "flow-mono-cli": "^1.5.0", "gaxios": "^4.3.2", "husky": "^7.0.0", "lint-staged": "^12.1.4", "patch-package": "^6.4.7", "postinstall-postinstall": "^2.0.0", "prettier": "^3.1.1" }, "resolutions": { "react-native-flipper": "https://registry.yarnpkg.com/@favware/skip-dependency/-/skip-dependency-1.1.1.tgz" } }