ESLint ignore specific rule for a specific directory

前端 未结 5 2175
隐瞒了意图╮
隐瞒了意图╮ 2020-12-08 02:35

Is it possible with ESLint to ignore one specific rule for an entire directory?

In my case, I would like to ignore import/prefer-default-export for a di

5条回答
  •  借酒劲吻你
    2020-12-08 02:53

    If there are multiple directories that you want to apply your rules to, then you can create different configs for different purposes. For example:

    • .eslintrc.json for common config
    • .eslintrc-main.json for main linting and run eslint -c .eslintrc-main src test
    • .eslintrc-comp.json for components and run eslint -c .eslintrc-comp commonComponents fooBarComponent

提交回复
热议问题