Error: 'basePath' should be an absolute path.
See original GitHub issueCommand:
$ prettier-eslint 'src/**/*.{ts,tsx}' --write
Executing this command throws an exception!
but when I use the full path, Like this:
$ prettier-eslint '/Users/cuijianwei/WebstormProjects/testproject/hasaki-cli-demo/gen-demo/src/**/*.{ts,tsx}' --write
no error is reported, but I want to support relative paths
When I use version 6.6.0 of eslint,also no error is reported;
Now I have to reduce the eslint version to solve this problem
Version:
prettier-eslint-cli
version:4.7.1prettier
version: 1.19.1eslint
version:6.7.1
Target:
// src/index.ts
const a = () => {
console.log(1);
};
What you did:
$ prettier-eslint 'src/**/*.{ts,tsx}' --write
What happened: Error Log:
prettier-eslint [ERROR]: There was trouble creating the ESLint CLIEngine.
prettier-eslint-cli [ERROR]: There was an error formatting "src/index.ts":
AssertionError [ERR_ASSERTION]: 'basePath' should be an absolute path.
at new IgnorePattern (/Users/cuijianwei/WebstormProjects/testproject/hasaki-cli-demo/gen-demo/node_modules/eslint/lib/cli-engine/config-array/ignore-pattern.js:178:9)
at ConfigArrayFactory._normalizeObjectConfigDataBody (/Users/cuijianwei/WebstormProjects/testproject/hasaki-cli-demo/gen-demo/node_modules/eslint/lib/cli-engine/config-array-factory.js:651:49)
at _normalizeObjectConfigDataBody.next (<anonymous>)
at ConfigArrayFactory._normalizeObjectConfigData (/Users/cuijianwei/WebstormProjects/testproject/hasaki-cli-demo/gen-demo/node_modules/eslint/lib/cli-engine/config-array-factory.js:594:20)
at _normalizeObjectConfigData.next (<anonymous>)
at createConfigArray (/Users/cuijianwei/WebstormProjects/testproject/hasaki-cli-demo/gen-demo/node_modules/eslint/lib/cli-engine/config-array-factory.js:338:25)
at ConfigArrayFactory.create (/Users/cuijianwei/WebstormProjects/testproject/hasaki-cli-demo/gen-demo/node_modules/eslint/lib/cli-engine/config-array-factory.js:393:16)
at createBaseConfigArray (/Users/cuijianwei/WebstormProjects/testproject/hasaki-cli-demo/gen-demo/node_modules/eslint/lib/cli-engine/cascading-config-array-factory.js:96:48)
at new CascadingConfigArrayFactory (/Users/cuijianwei/WebstormProjects/testproject/hasaki-cli-demo/gen-demo/node_modules/eslint/lib/cli-engine/cascading-config-array-factory.js:211:30)
at new CLIEngine (/Users/cuijianwei/WebstormProjects/testproject/hasaki-cli-demo/gen-demo/node_modules/eslint/lib/cli-engine/cli-engine.js:563:36)
failure formatting 1 file with prettier-eslint
error Command failed with exit code 1.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:56
- Comments:12 (3 by maintainers)
Top Results From Across the Web
There was trouble creating the ESLint CLIEngine
test.js": AssertionError [ERR_ASSERTION]: 'basePath' should be an absolute path.
Read more >How to fix Blazor WASM base path problems - elmah.io Blog
This post will show you how to fix a common problem when setting the application base path with Blazor WebAssembly.
Read more >Argument BasePath must be a path to a folder - Visual Basic
The argument BasePath must consist of a path to a folder. You may be parsing a string incorrectly and supplying a value that...
Read more >Paths and Operations - Swagger
The full request URL is constructed as scheme://host/basePath/path . Path Templating. Swagger supports path templating, meaning you can use curly braces {} to ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m getting the same issue.
It’s a stopgap solution, but adding
$PWD
in front of your glob seems to fix it. might need to usecross-env
if you support non-nix systems.Example:
+1