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

Do you want to use ESLint? #75

Open
btmills opened this issue Apr 23, 2017 · 0 comments
Open

Do you want to use ESLint? #75

btmills opened this issue Apr 23, 2017 · 0 comments

Comments

@btmills
Copy link

btmills commented Apr 23, 2017

I cloned the repository because I've been meaning to see what's going with class instance properties. (Foolish? Maybe 😐 But in the worst case, I learn something about React internals, Babel plugins, or hot reloading :neckbeard: I call that a win 🥇 ) However, when I opened Atom, it wasn't happy about ESLint not being installed. Since it's a weekend and I'm free to yak shave, I'd like to fix that.

I'm opening this issue to ask what approach the maintainers prefer. I can do any combination of the following, ordered according to increasing magnitude of change:

  1. Delete the .eslintrc file. All done, problem solved.

  2. Add eslint@^0.24.1 and babel-eslint@^4.1.8 to devDependencies.

    Based on the contents of the .eslintrc, I can tell that it was originally used with a v0.x release of ESLint because it overrides some rules that were enabled by default in the v0.x releases - when we shipped v1.0, we disabled all rules by default.

    Fix ESLint configuration #54 already addressed the editor complaints in the 1.x branch by adding the missing devDependencies, but it installed ESLint v2, which means quotes is now the only rule enabled in the 1.x branch in this repository.

  3. Fix 15 existing lint errors in `src/`.
    $ node_modules/.bin/eslint src
    
    src/createClassProxy.js
       74:8   error  Missing semicolon                                     semi
       81:21  error  The Function constructor is eval                      no-new-func
      119:8   error  existingProxy is already declared in the upper scope  no-shadow
      121:6   error  Expected no return value                              consistent-return
      138:4   error  The '__proto__' property is deprecated                no-proto
      138:31  error  The '__proto__' property is deprecated                no-proto
      226:3   error  Unnecessary semicolon                                 no-extra-semi
      265:9   error  The '__proto__' property is deprecated                no-proto
    
    src/createPrototypeProxy.js
      111:4  error  Expected no return value                consistent-return
      174:4  error  The '__proto__' property is deprecated  no-proto
      190:1  error  Unnecessary semicolon                   no-extra-semi
    
    src/deleteUnknownAutoBindMethods.js
      50:4  error  Expected no return value  consistent-return
      53:4  error  Expected no return value  consistent-return
    
    src/supportsProtoAssignment.js
      4:2  error  The '__proto__' property is deprecated  no-proto
      9:1  error  Unnecessary semicolon                   no-extra-semi
    
    ✖ 15 problems (15 errors, 0 warnings)
  4. In `tests/`, enable the `mocha` environment, disable `no-unused-vars`, and fix 19 remaining errors.
    test/consistency.js
      299:6  error  Missing semicolon  semi
    
    test/helpers/createShallowRenderer.js
       12:38  error  Strings must use singlequote  quotes
       13:35  error  Strings must use singlequote  quotes
       14:31  error  Strings must use singlequote  quotes
       15:34  error  Strings must use singlequote  quotes
       16:27  error  Strings must use singlequote  quotes
       17:41  error  Strings must use singlequote  quotes
       18:21  error  Strings must use singlequote  quotes
       25:3   error  "options" is not defined      no-undef
      119:42  error  Missing semicolon             semi
    
    test/instance-method-autobinding.js
      228:4  error  Missing semicolon  semi
    
    test/instance-method.js
      148:1  error  Unnecessary semicolon  no-extra-semi
    
    test/legacy-support.js
      2:54  error  Missing semicolon  semi
    
    test/pure-component.js
      25:3  error  Missing semicolon  semi
    
    test/static-descriptor.js
       98:17  error  Unexpected trailing comma  comma-dangle
      102:17  error  Unexpected trailing comma  comma-dangle
    
    test/static-method.js
       10:5   error  Unnecessary semicolon      no-extra-semi
       22:5   error  Unnecessary semicolon      no-extra-semi
      114:27  error  Unexpected trailing comma  comma-dangle
    
    ✖ 19 problems (19 errors, 0 warnings)
  5. Upgrade to a newer version of ESLint, extend eslint:recommended, and fix any lint errors.

    When we stopped enabling default rules in v1.0, we created eslint:recommended, which omits stylistic rules and enables "you probably didn't mean to do this" rules. Extending eslint:recommended would be most similar to the current behavior of using the default rules and disabling a few.

  6. Add a lint step to the test script in package.json.

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