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

Refactor ESLint configuration to enable better IDE integration #13914

Merged
merged 2 commits into from
Nov 8, 2018
Merged

Refactor ESLint configuration to enable better IDE integration #13914

merged 2 commits into from
Nov 8, 2018

Conversation

NMinhNguyen
Copy link
Contributor

@NMinhNguyen NMinhNguyen commented Oct 21, 2018

Per #11794 (comment), this change ensures a single ESLint config is used for source code, Node.js scripts, and npm files via the overrides option, which should allow IDEs to provide lint feedback inline without having to use yarn linc.

@sizebot
Copy link

sizebot commented Oct 21, 2018

Details of bundled changes.

Comparing: e3a7b96...416e45c

scheduler

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
scheduler.development.js n/a n/a 0 B 19.17 KB 0 B 5.74 KB UMD_DEV
scheduler.production.min.js n/a n/a 0 B 3.16 KB 0 B 1.53 KB UMD_PROD

Generated by 🚫 dangerJS

.eslintrc.js Show resolved Hide resolved
},
rules: {
'no-var': ERROR,
strict: OFF,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had to turn this rule off because strict: ERROR with sourceType: 'module' causes errors such as

/react/packages/create-subscription/index.js
  10:1  error  'use strict' is unnecessary inside of modules  strict

scripts/eslint/index.js Outdated Show resolved Hide resolved
@@ -10,6 +10,7 @@
'use strict';

(function(global, factory) {
// eslint-disable-next-line no-unused-expressions
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of adding these to each UMD bundle, I could add another overrides section disabling this rule. Something like

// .eslintrc.js
{
  overrides: [
    // ...
    {
      files: ['packages/*/npm/umd/*.js'],
      rules: {
        'no-unused-expressions': OFF,
      }
    }
  ]
}

@gaearon gaearon merged commit 3d8bda7 into facebook:master Nov 8, 2018
@gaearon
Copy link
Collaborator

gaearon commented Nov 8, 2018

Thanks!

jetoneza pushed a commit to jetoneza/react that referenced this pull request Jan 23, 2019
…ook#13914)

* Refactor ESLint configuration to enable better IDE integration

* Minor tweaks
n8schloss pushed a commit to n8schloss/react that referenced this pull request Jan 31, 2019
…ook#13914)

* Refactor ESLint configuration to enable better IDE integration

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

Successfully merging this pull request may close these issues.

5 participants