I just installed Meteor 3 and created a new project. I added eslint and a very bare config file but when I run eslint, it tries to lint the whole .meteor directory. I have the line ignores: [ '.meteor/', 'node_modules/', 'package-lock.json' ]
but nothing is working
I think the answer is code editor specific. What editor do you use?
Do you have the .eslintignore in the root of your project?, alongside .eslintrc or your ESLint config file
With .eslintignore you can use the same formatting you would use for git ignore files? In your case the file would just contain:
.meteor/
node_modules/
package-lock.json
Alternatively, you can try to run eslint . --ignore-path .eslintignore
specifying the ignore file, but it should grab that one by default.
I was able to solve this by putting the ignores
key in a config object at the start of the config like this
// @ts-check
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';
export default tseslint.config(
{
ignores: ['.meteor/', 'node_modules/', 'package-lock.json'],
},
eslint.configs.recommended,
...tseslint.configs.recommended,
{
// other rules
},
);
Also, .eslintignore is no longer recommended with eslint v9 and up
1 Like