Skip to content

How to exclude file from linting? #413

Answered by dsvgl
AloisSeckar asked this question in Q&A
Discussion options

You must be logged in to vote

I also had problems with ignoring. I have a separate package with separate eslint configs.
I have a dedicated config for when it should be used inside withNuxt (aka the package/app is a nuxt app).

export const companyIgnores = {
  // NOTE: no "name" else, it wouldn't work; maybe a bug in ESLint
  ignores: ['**/node_modules', '**/public', '**/vendor', '**/dist', '**/.nuxt'],
};

export const configNuxt = [eslintPluginPrettierRecommended, companyEslintRules, companyIgnores];

This works for me. Could you try making entry an array?

export default withNuxt([
  {
    ignores: ['**/_api.ts'],
  },
  // other config
]);

You could also try to prepend the ignores befor the nuxt rules:

export default 

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by AloisSeckar
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@dsvgl
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants