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

Improve lint configuration strategy #60

Open
randycoulman opened this issue May 15, 2017 · 0 comments
Open

Improve lint configuration strategy #60

randycoulman opened this issue May 15, 2017 · 0 comments

Comments

@randycoulman
Copy link
Contributor

randycoulman commented May 15, 2017

Our current strategy for dealing with lint configuration is not ideal and needs to be improved.

Background

There are (at least) three places we need to be able to run eslint:

  • From the command-line via yarn lint
  • Within a text editor such as Atom
  • Via the eslint webpack loader (shows up when running yarn start and in the browser console)

The original react-scripts only supports the last mechanism (running via eslint-loader); we've added the first two with customizations in our @zeal/react-scripts fork.

Current Strategy

  • @zeal/react-scripts contains all of the lint-related dependencies
  • @zeal/react-scripts provides a lint script to run the linter using its own dependencies
  • @zeal/react-scripts contains no lint configuration of its own; it relies on eslint's ability to search up a file tree to find a configuration file. The host project generally defines this configuration.

Requirements

  • We want to be able to resolve imports relative to our app's client directory.
  • Client applications should be able to define local rule configuration overrides.
  • Client applications should be able to install more eslint plugins and use them in their configurations.
  • The client application and @zeal/react-scripts should not have to duplicate installed packages or configuration files.

Issues

Ideas

  • Consider switching to babel-plugin-module-resolver and its associated eslint resolver to resolve imports relative to client instead of using webpack to do this.

  • Consider moving all of the lint dependencies to the client project, removing them from @zeal/react-scripts. This may not work with the eslint-loader.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant