v0.13.0 crashes on plugin shared config
Opened this issue · 12 comments
I tried to use:
"overrides": [
{
"files": ["test.js"],
"extends": ["plugin:ava/recommended"]
}
]
And things crashed.
TypeError: Cannot read property 'charAt' of null
at posix (/Users/jamestalmage/WebstormProjects/async-task-pool/node_modules/path-is-absolute/index.js:4:13)
at isFilePath (/Users/jamestalmage/WebstormProjects/async-task-pool/node_modules/eslint/lib/config/config-file.js:80:12)
at /Users/jamestalmage/WebstormProjects/async-task-pool/node_modules/eslint/lib/config/config-file.js:344:20
at Array.reduceRight (native)
at Object.applyExtends (/Users/jamestalmage/WebstormProjects/async-task-pool/node_modules/eslint/lib/config/config-file.js:338:28)
at loadConfig (/Users/jamestalmage/WebstormProjects/async-task-pool/node_modules/eslint/lib/config.js:63:37)
at new Config (/Users/jamestalmage/WebstormProjects/async-task-pool/node_modules/eslint/lib/config.js:171:44)
at CLIEngine.executeOnFiles (/Users/jamestalmage/WebstormProjects/async-task-pool/node_modules/eslint/lib/cli-engine.js:493:28)
at runEslint (/Users/jamestalmage/WebstormProjects/async-task-pool/node_modules/xo/index.js:67:16)
at /Users/jamestalmage/WebstormProjects/async-task-pool/node_modules/xo/index.js:40:11
I am not sure if it is overrides specific
There is a $80.00 open bounty on this issue. Add more on Issuehunt.
- Checkout the Issuehunt explorer to discover more funded issues.
- Need some help from other developers? Add your repositories on Issuehunt to raise funds.
I am not sure if it is overrides specific
It does not appear to be
@jamestalmage Probably https://github.com/sindresorhus/xo/blob/bfb1b4fed0e6b8d946c341bdc06f65d63265a0db/options-manager.js#L105-L116 Maybe we should ask ESLint to expose that method?
I'm getting the same error when I do this in the package.json
:
"xo": {
"space": 2,
"plugin": ["lodash-fp"],
"extends": ["plugin:lodash-fp/recommended"]
}
or with the cli
xo --plugin lodash-fp --extend plugin:eslint-plugin-lodash-fp/recommended
but it works fine when I go and modify xo
configuration in the node_modules
module.exports = {
plugins: [
'lodash-fp',
'no-use-extend-native',
'import-order',
'ava',
'xo',
'promise'
],
extends: [
'plugin:lodash-fp/recommended',
'plugin:ava/recommended',
'plugin:xo/recommended'
],
rules: {
'no-use-extend-native/no-use-extend-native': 2,
'import-order/import-order': 2,
'promise/param-names': 2
}
};
(v0.15)
v0.16
Just got this. If you try to use a plugin, it results in the options array passed to eslint having a null in the extends array (because resolve-from
doesn't find it). Tried a few other ways, but couldn't get a plugin's recommended config to work in any way.. Any steps forward with this?
Any steps forward with this?
Opening an issue on ESLint asking them to expose the method for resolving extends
, so we don't have to implement a "broken" version ourselves. https://github.com/eslint/eslint/issues
Any steps backward with this to make it work i.e. any previous version of xo or eslint which can fix this issue?
ESLint issue opened: eslint/eslint#7328
The ESLint team says the underlying problem has been fixed in ESLint, so we should be able to rip out our custom resolve logic:
Lines 254 to 282 in 510d02e
We need to add a lot of test to confirm everything is still working though.
@issuehuntfest has funded $80.00 to this issue. See it on IssueHunt
I think current resolve logic on shared config still don't include baseConfig.cwd
Eslint has a rfc eslint/rfcs#7 to simplify the resolution of sharable configs. Maybe we wait on this first.
Yeah, probably smart.