Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generator creating .eslintrc.json at the root path even when .eslintrc.js already exist #7791

Closed
lyczos opened this issue Nov 18, 2021 · 4 comments · Fixed by #10080
Closed
Labels
community This is a good first issue for contributing outdated scope: react Issues related to React support for Nx type: bug

Comments

@lyczos
Copy link

lyczos commented Nov 18, 2021

Current Behavior

In my project, I'm using .eslintrc.js (javascript) as a root config for ESLint (my config needs dynamic paths and some other JS-related features so JSON is a limitation).
When I'm using a generator for creating lib/app then every time .eslintrc.json file is created.

Expected Behavior

NX Generator should at least check if .eslintrc.js exist at the root level and if so do not create .eslintrc.json file.

Steps to Reproduce

  1. create .eslintrc.js with some basic config
  2. remove .eslintrc.json
  3. generate new application
  4. check root directory - .eslintrc.json is created

Failure Logs

Environment


  Node : 14.16.1
  OS   : darwin x64
  npm  : 6.14.12
  
  nx : Not Found
  @nrwl/angular : 12.9.0
  @nrwl/cli : 12.9.0
  @nrwl/cypress : 12.9.0
  @nrwl/devkit : 12.9.0
  @nrwl/eslint-plugin-nx : 12.9.0
  @nrwl/express : Not Found
  @nrwl/jest : 12.9.0
  @nrwl/linter : 12.9.0
  @nrwl/nest : Not Found
  @nrwl/next : 12.9.0
  @nrwl/node : Not Found
  @nrwl/nx-cloud : Not Found
  @nrwl/react : 12.9.0
  @nrwl/schematics : Not Found
  @nrwl/tao : 12.9.0
  @nrwl/web : 12.9.0
  @nrwl/workspace : 12.9.0
  @nrwl/storybook : 12.9.0
  @nrwl/gatsby : Not Found
  typescript : 4.3.5
@FrozenPandaz FrozenPandaz added community This is a good first issue for contributing scope: react Issues related to React support for Nx labels Nov 18, 2021
@FrozenPandaz
Copy link
Collaborator

Would someone like to open a PR that does the following?

  1. Checks if an eslint config exists.
  2. Updates the logic when creating a new library to extend whichever eslint config exists at the root.

@wilgert
Copy link

wilgert commented Feb 8, 2022

We worked around this problem by creating an .eslintrc.json at the root that contains:
{ "extends": ["./.eslintrc.js"] }

@AloisH
Copy link
Contributor

AloisH commented Apr 30, 2022

Hello I made a PR fixing this issues.
Here is the link: #10080

@github-actions
Copy link

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
community This is a good first issue for contributing outdated scope: react Issues related to React support for Nx type: bug
Projects
None yet
4 participants