Can't find config when Node version > 12.x.x
See original GitHub issueTell us about your environment
- ESLint Version: v6.8.0 (Currently used)
- Node Version: v13.8.0
- npm Version: v6.13.7
What parser (default, Babel-ESLint, etc.) are you using?
Please show your full configuration:
Configuration
module.exports = {
parser: '@typescript-eslint/parser',
extends: [
'preact',
'plugin:@typescript-eslint/recommended',
'prettier/@typescript-eslint',
'plugin:prettier/recommended'
],
settings: {
react: {
pragma: 'h',
version: 'detect'
},
},
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
ecmaFeatures: {
jsx: true
}
},
ignorePatterns: ['build/'],
rules: {
'indent': ['warn', 4, { "SwitchCase": 1, "ignoredNodes": ["TemplateLiteral > *"] }],
'react/jsx-indent': ['warn', 4],
'react/jsx-indent-props': ['warn', 4],
'react/no-unknown-property': ['error', { ignore: ['class'] }],
'react/no-unescaped-entities': ['warn'],
'react/jsx-no-bind': ['off'],
'quotes': 'off',
'@typescript-eslint/quotes': ['warn', 'single'],
'@typescript-eslint/no-use-before-define': ['off'],
'arrow-parens': 'warn',
'@typescript-eslint/ban-ts-ignore': ['warn'],
'@typescript-eslint/interface-name-prefix': 'off',
'semi': 'off',
'@typescript-eslint/semi': ['warn'],
},
overrides: [
{
files: ["*.js"],
rules: {
"@typescript-eslint/explicit-function-return-type": "off",
}
}
]
};
eslint src/**/*.{js,ts,tsx} --fix
What did you expect to happen? Eslint to run against my application using the preact config
What actually happened? Please include the actual, raw output from ESLint.
Oops! Something went wrong! :(
ESLint: 6.8.0.
ESLint couldn't find the config "preact" to extend from. Please check that the name of the config is correct.
The config "preact" was referenced from the config file in "/x/x/x/.eslintrc.js".
I added the eslint-config-preact package to my application to replace the React config, as I do use Preact, and this was fine and worked on my machine. However, once the build server failed, I noticed multiple coworkers had the same issue. Eventually I came to checking versions of Node, and noticed Eslint won’t be able to find that config if the version is greater than 12.x.x.
If this isn’t an Eslint issue but an issue with the config itself, I can always create an issue there, but I’d assume it’s the underlying tool first.
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (3 by maintainers)
Top GitHub Comments
Looks like “eslint-config-preact” is using the “exports” field, which is newly respected in node 13.3+, and the “conditional exports” feature, which was added in v13.7.
See https://unpkg.com/browse/eslint-config-preact@1.1.0/package.json, it’s using the “exports” field. The “main” and the “require” are the same, so it should work in v13.7+, but because it lacks a “default” as well, it will not work in node v13.3 - v13.6. (cc @developit)
I’m not sure why it wouldn’t be working in node v13.8, however.
Indeed, that is true. Only main/bin have the legacy mistake of not requiring
./
for relative paths.