Error: Failed to load plugin 'prettier' declared in 'BaseConfig'
younho9 opened this issue · 3 comments
younho9 commented
When I run yarn xo
command, encounter following error message.
TypeError [ERR_INVALID_ARG_VALUE]: Failed to load plugin 'prettier' declared in 'BaseConfig': The argument 'filename' must be a file URL object, file URL string, or absolute path string. Received ''
Referenced from: BaseConfig
at new NodeError (node:internal/errors:371:5)
at createRequire (node:internal/modules/cjs/loader:1214:13)
My XO Configuration.
"xo": {
"prettier": true,
"extends": [
"next/core-web-vitals"
]
},
To reproduce,
yarn create next-app
- remove default
eslintrc.json
- add
xo
field to package.json and add above xo configuration.
Related with
jonahsnider commented
Try following these instructions.
I'm able to reproduce the error when I extend next/core-web-vitals
like you posted but using the config from Usage With Other Tools
seems to work.
younho9 commented
Thanks. Using config of next plugin as you commented works.
module.exports = {
extends: [
//...
'plugin:@next/next/recommended',
],
}
But, eslint-config-next
is using several plugins internally, if I extend it directly from xo config, it seems to cause error.
I'm still wondering if there are any restrictions on extending other configs.