Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3408002
D10544.id35221.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D10544.id35221.diff
View Options
diff --git a/.lintstagedrc.js b/.lintstagedrc.js
--- a/.lintstagedrc.js
+++ b/.lintstagedrc.js
@@ -1,16 +1,20 @@
-const { CLIEngine } = require('eslint');
+const { ESLint } = require('eslint');
const { getClangPaths } = require('./scripts/get_clang_paths');
const { findRustProjectPath } = require('./scripts/get_cargo_path');
-const cli = new CLIEngine({});
+const removeIgnoredFiles = async (files) => {
+ const eslint = new ESLint();
+ const isIgnored = await Promise.all(
+ files.map(file => eslint.isPathIgnored(file)),
+ );
+ const filteredFiles = files.filter((_, i) => !isIgnored[i]);
+ return filteredFiles.join(' ');
+}
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 --report-unused-disable-directives --max-warnings=0 ' +
- files.filter(file => !cli.isPathIgnored(file)).join(' ')
- );
+ '*.{js,mjs,cjs}': async function eslint(files) {
+ const filesToLint = await removeIgnoredFiles(files);
+ return [`eslint --cache --fix --report-unused-disable-directives --max-warnings=0 ${filesToLint}`];
},
'*.{css,html,md,json}': function prettier(files) {
return 'prettier --write ' + files.join(' ');
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Dec 5, 9:11 AM (16 h, 24 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2614868
Default Alt Text
D10544.id35221.diff (1 KB)
Attached To
Mode
D10544: [RN72] Fix lint-staged
Attached
Detach File
Event Timeline
Log In to Comment