Linting a library which has storybook configurations causes lint errors.
Linter should success without errors.
npx create-nx-workspace workspace
? What to create in the new workspace react
? Application name web
? Default stylesheet format emotion
? Use Nx Cloud? (It's free and doesn't require registration.) No
Creating a sandbox with Nx...
npm run nx g lib components
npm i -D @nrwl/storybook
npm run nx g storybook-configuration components
? Configure a cypress e2e app to run against the storybook instance? Yes
? Automatically generate story files for components declared in this library? Yes
? Automatically generate *.spec.ts files in the cypress e2e app generated by the cypress-configure schematic? Yes
npm run lint components
> nx workspace-lint && nx lint "components"
> nx run components:lint
Linting "components"...
/Users/puku0x/Desktop/workspace/libs/components/.storybook/main.js
0:0 error Parsing error: "parserOptions.project" has been set for @typescript-eslint/parser.
The file does not match your project config: libs/components/.storybook/main.js.
The file must be included in at least one of the projects provided
/Users/puku0x/Desktop/workspace/libs/components/.storybook/preview.js
0:0 error Parsing error: "parserOptions.project" has been set for @typescript-eslint/parser.
The file does not match your project config: libs/components/.storybook/preview.js.
The file must be included in at least one of the projects provided
/Users/puku0x/Desktop/workspace/libs/components/.storybook/webpack.config.js
0:0 error Parsing error: "parserOptions.project" has been set for @typescript-eslint/parser.
The file does not match your project config: libs/components/.storybook/webpack.config.js.
The file must be included in at least one of the projects provided
✖ 3 problems (3 errors, 0 warnings)
Lint errors found in the listed files.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] lint: `nx workspace-lint && nx lint "components"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] lint script.
> NX Report complete - copy this into the issue template
nx : Not Found
@nrwl/angular : Not Found
@nrwl/cli : 10.3.0
@nrwl/cypress : 10.3.0
@nrwl/eslint-plugin-nx : 10.3.0
@nrwl/express : Not Found
@nrwl/jest : 10.3.0
@nrwl/linter : 10.3.0
@nrwl/nest : Not Found
@nrwl/next : Not Found
@nrwl/node : Not Found
@nrwl/react : 10.3.0
@nrwl/schematics : Not Found
@nrwl/tao : 10.3.0
@nrwl/web : 10.3.0
@nrwl/workspace : 10.3.0
typescript : 4.0.3
It can be solved by modifying ignorePatterns in .eslintrc.json.
{
"extends": ["../../.eslintrc.json"],
"ignorePatterns": ["!**/*", ".storybook/*"],
It can be solved by modifying
ignorePatternsin.eslintrc.json.{ "extends": ["../../.eslintrc.json"], "ignorePatterns": ["!**/*", ".storybook/*"],
Ah, thank you. It's so annoying that globs don't work for dot-prefixed files and folders. And I always forget that.
I also got this eslint error when I updated from [email protected] to [email protected] few days ago
I tried to use workaround above, but still get the error in *.stories.tsx files
I also got this
eslinterror when I updated from[email protected]to[email protected]few days ago
I tried to use workaround above, but still get the error in*.stories.tsxfiles
Can confirm that I also am getting the errors in the stories.tsx files.
Most helpful comment
It can be solved by modifying
ignorePatternsin.eslintrc.json.