linter-eslint icon indicating copy to clipboard operation
linter-eslint copied to clipboard

Add support for ignore-path

Open arv opened this issue 6 years ago • 5 comments

Issue Type

Feature Request

Issue Description

We run our eslint as follows:

eslint --ignore-path=<PathToFileDefiningWhatToIgnore> ...

as described here: https://eslint.org/docs/user-guide/command-line-interface#ignore-path

It would be nice if there was an option to define the same thing using AtomLinter/linter-eslint

Bug Checklist

  • [x] Restart Atom
  • [x] Verify the eslint CLI gives the proper result, while linter-eslint does not
  • [x] Paste the output of the Linter Eslint: Debug command from the Command Palette below
Atom version: 1.24.0
linter-eslint version: 8.4.1
ESLint version: 4.17.0
Hours since last Atom restart: 0
Platform: darwin
Using local project ESLint from: /src/quip/node_modules/eslint
Current file's scopes: [
  "source.js.jsx",
  "punctuation.terminator.statement.js"
]
linter-eslint configuration: {
  "disableWhenNoEslintConfig": false,
  "eslintRulesDirs": [
    "/src/quip/static/tools/eslint/rules/"
  ],
  "eslintrcPath": "/src/quip/static/tools/eslint/eslintrc.yml",
  "lintHtmlFiles": false,
  "useGlobalEslint": false,
  "showRuleIdInMessage": true,
  "globalNodePath": "",
  "advancedLocalNodeModules": "",
  "disableEslintIgnore": false,
  "disableFSCache": false,
  "fixOnSave": false,
  "scopes": [
    "source.js",
    "source.jsx",
    "source.js.jsx",
    "source.babel",
    "source.js-semantic"
  ],
  "rulesToSilenceWhileTyping": [],
  "rulesToDisableWhileFixing": [],
  "ignoreFixableRulesWhileTyping": false
}

arv avatar Feb 16 '18 18:02 arv

Not sure how we would approach this. Some concerns coming immediately to mind:

  • We actually use location of a .eslintignore as one of the flags for locating your project root. How should your specified ignore file interact with this behavior?

  • Is this ignore file expected to be global? If not, are you wanting us to keep a list matching up all your projects to their respective ignore files?

We currently do not track anything. Except for a little bit of caching, we basically do a new search for your project config and the correct copy of eslint every time a lint runs. The only reasonably easy way I can think of to add this feature would be to put a file in your project root to tell us where to find the ignore file, which seems to defeat the whole purpose of the request.

skylize avatar Feb 16 '18 18:02 skylize

I would expect this to be global, just like the eslintrcPath and eslintRulesDirs and have to have absolute paths. The path inside the ignore-path would probably be relative to the working directory.

arv avatar Feb 16 '18 19:02 arv

Hi @arv. Each option we add comes with a maintenance cost and cognitive burden for our users. I'd like to understand your use case to see why this is worth adding. Can you please describe a bit about your setup and why this would be an important option for you to have?

IanVS avatar Feb 16 '18 21:02 IanVS

Our precommit runs something like:

eslint --config=<PATH> --ignore-path=<PATH> --rulesdir=<PATH> ...

AtomLinter/linter-eslint supports both config and rulesdir but not ignore-path which leads to lots of false positives when editing in Atom.

arv avatar Feb 17 '18 01:02 arv

So, do you have an ignore file that is named something different from .eslintignore, which is why you need to use --ignore-path?

IanVS avatar Feb 17 '18 01:02 IanVS