Giter Site home page Giter Site logo

eslint-config-gulp's People

Contributors

coreyfarrell avatar erikkemperman avatar gucong3000 avatar leo avatar pdehaan avatar phated avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

eslint-config-gulp's Issues

Missing critical rules

I just noticed during a refactor of vinyl-fs that we are missing critical rules that I expect like no-undef. @pdehaan do you think we should extend from eslint:recommended and adjust our ruleset from there? /cc @contra

Parse ES2018 even if we don't want to support it

If we are going to continue blocking ES2018 syntax I ask that we enable node/no-unsupported-features/es-syntax here configured with [2, {"version": ">=0.10"}]. The current situation is that ESLint fails to parse any ES6+, so it only reports the first issue it finds. Updating the ESLint parser options (see #17) and adding that rule would allow ESLint to successfully parse my code changes and report a list of all errors with clearer reasons.

For example using the existing eslint-config-gulp against my current fs-mkdirp-stream code reports:

/usr/src/npm/fs-mkdirp-stream/index.js
  3:1  error  Parsing error: The keyword 'const' is reserved

/usr/src/npm/fs-mkdirp-stream/test/index.js
  5:5  error  Parsing error: Unexpected token {

With #17 plus the addition I'm proposing here:

/usr/src/npm/fs-mkdirp-stream/index.js
   3:1  error  Block-scoped variables in strict mode are not supported until Node.js 4.0.0. The configured version range is '>=0.10'  node/no-unsupported-features/es-syntax
   3:7  error  Destructuring is not supported until Node.js 6.0.0. The configured version range is '>=0.10'                           node/no-unsupported-features/es-syntax
   5:1  error  Block-scoped variables in strict mode are not supported until Node.js 4.0.0. The configured version range is '>=0.10'  node/no-unsupported-features/es-syntax
  22:5  error  Property shorthands are not supported until Node.js 4.0.0. The configured version range is '>=0.10'                    node/no-unsupported-features/es-syntax

/usr/src/npm/fs-mkdirp-stream/test/index.js
   5:5  error  Destructuring is not supported until Node.js 6.0.0. The configured version range is '>=0.10'  node/no-unsupported-features/es-syntax
  11:5  error  Destructuring is not supported until Node.js 6.0.0. The configured version range is '>=0.10'  node/no-unsupported-features/es-syntax

eslint-index

I have created an ESLint utility module that I thought you might find useful.

The module is called eslint-index and you can read the full documentation on npm.

eslint-index provides a great deal of functionality including:

  • List all available rules declared by ESLint and any plugins you have included
  • Colour code rules depending on their status:
    • omitted (not declared anywhere in you ESLint config file)
    • 0|off (declared, but set to 0|off)
    • 1|warn
    • 2|error
  • Display links to the rule documentation page next to each rule
  • Filter/reject rules by their status and/or their group
    • status is as described above (omitted|off|warn|error)
    • group is eslint for the core ESLint rules or the name of any of your plugins like react|import|flowtype
  • Format the output as a number or a table to get an overview of your rule settings
  • Rules that have been marked as deprecated are removed from all outputs
  • All of the above filters and formatting can be combined, for example:
    • filter omitted and off rules, output them as a list and display the rule doc links alongside
    • filter eslint rules and display the rule setting counters in a table

I wrote this plugin to aid the development of my own ESLint config settings and found it incredibly useful for keeping track of everything. I hope you find this module useful and please do let me know if you have any ideas on how to improve it.

Switch to XO ESLint rules?

Currently we're using our own default rules in the /.eslintrc file.

In gulpjs/gulp#1262 (comment) @phated suggested using the xo config (since felixge/node-style-guide isn't super maintained).

@sindresorhus suggested that we just extend the eslint-config-xo-space config and override the rules that we don't agree with; which I believe were the following (source):

  • inconsistently quoted properties
  • inline comments
  • unexpected require warning
  • object-curly-spacing on single key, inline objects

Needs tests

I didn't catch duplicate keys before publish. It'd be nice to have some sort of tests on this repo.

Work together on eslint-config-defaults

Hello! I wanted to propose a collaboration between this repo and https://github.com/walmartlabs/eslint-config-defaults.

I originally set out to build config-defaults because I was tired of copy pasting my eslint config around and trying to keep them up to date across lots of projects. Eslint's extends key fixes the distribution problem but there are still two issues:

  1. Managing the eslint config file is a pain in the ass even though it is centralized. New rules are added, removed, moved and deprecated all the time and organization is terrible.
  2. Just getting up and running for a new project is not straightforward anymore and I strongly believe that code quality tooling should be well suited to those who are just starting out as they're often the ones who need it most after all.

So with this project I centralized a few configs from major players, I committed to staying on top of the latest rules (and deprecations) and most importantly I made the config composable which allows them to be easily mixed and matched!


It's obvious that you all saw the same problems and it has been enormously helpful to a lot of people but I want to take your config one step further and I am asking for your help. With eslint-config-defaults I want to try to centralize the config from a few thought leaders around the web so that folks have fast, standard and up to date options from the start.

I've been maintaining a few "unofficial" configs for a while now but it's duplicate effort and my hope is to try to collaborate/consolidate. For my part, I am committed to staying on top of the latest rules as they change. I should mention that you all have quite a few missing rules already :).

Potential Objections(?):

  • We need quick access to the repo to make changes. - I'm happy to try to get your maintainers added to the project.
  • The project is under walmartlabs and I'm not too sure I like that. - It's possible we could spin this out into it's own org. No promises, I'd have to talk to legal and such about what we can do but we may be able to find a way.
  • This project is an important part of our OSS portfolio that we're not going to shut down. - You could easily take config-defaults as a dependency and keep this exactly how it is.

Anyway, I wanted to start a conversation and see if we can make it work for both of us.

@phated @pdehaan

Add a config file for the test directory

Currently, some of the repos have a couple of overrides in the main .eslintrc to deal with long test names, etc. We can put those overrides into a file that ships with this library and then add an .eslintrc to the test folder that extends the test ruleset.

Extend node-style-guide?

We have node-style-guide and eslint-config-node-style-guide to choose from.

But it may be good to use node-style-guide as a base set of rules and then define our overrides in eslint-config-gulp. It'd make it easier to track that we've overridden the "object-curly-spacing": [2, "always"] rule (or any other future rules).

Basically, npm i eslint-config-node-style-guide -D and then set our eslint.json like:

{
  "extends": "node-style-guide",
  "rules": {
    "object-curly-spacing": [2, "always"]
  }
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.