GithubHelp home page GithubHelp logo

eslint-config-hexo's People

Contributors

curbengh avatar dependabot-preview[bot] avatar jlhwung avatar kecrily avatar noahdragon avatar segayuu avatar sukkaw avatar tomap avatar tommy351 avatar yoshinorin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

eslint-config-hexo's Issues

DeprecationWarning: The `punycode` module is deprecated

(node:29131) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)

Can we update the module to replace "punycode"?

enable "Require confirmation of pull requests before merging"

I mistakenly committed directly to the master branch.
After that I did a Revert and did a rewind but I think that I should avoid making such mistakes in the future.
Should I enable "Require confirmation of pull requests before merging" setting in the master branch?

space-before-function-paren rules for 'asyncArrow'

I have faced the issue during reviewing the PR hexojs/hexo#3954

Currently we are using ['error', 'never']:

'space-before-function-paren': ['error', 'never'],

function foo() {
    // ...
}

var bar = function() {
    // ...
};

var bar = function foo() {
    // ...
};

class Foo {
    constructor() {
        // ...
    }
}

var foo = {
    bar() {
        // ...
    }
};

var foo = async() => 1

IMHO we could add a space between async & await and function for better distinguishment (['error', {"anonymous": "never", "named": "never", "asyncArrow": "always"}]), which will resulted in:

function foo() {
    // ...
}

var bar = function() {
    // ...
};

class Foo {
    constructor() {
        // ...
    }
}

var foo = {
    bar() {
        // ...
    }
};

var foo = async (a) => await a

"anonymous" and "named" retain never for consistency.

Should we use Prettier?

eslint has nearly 90 rules even for category Stylistic Issues alone.
It is very difficult to handle all these correctly.

Because eslint understands that, if you activate only recommended settings, required items in most projects will be set. However, Stylistic Issues often depends on individuality, the recommended config is no-mixed-spaces-and-tabs only.

By using Prettier it is certain that almost all of those settings will be unified.
However, that is a tradeoff with fewer things we can explicitly control.
In fact, the multi-line option of the curly rule will be disabled with Prettier!

Possible errors & improvements.

  1. When i install config globally, plugin:node/recommended will install into eslint-config-hexo directory (under subdir). And plugin actually not work, because eslint must see node plugin in same level hierarchy. But then i install it locally, node plugin will placed in same level as eslint.

    node -v && npm -v
    v6.14.0
    3.10.10
    [root@localhost ivan-nginx]# npm i -g eslint-config-hexo
    /usr/lib
    ├── UNMET PEER DEPENDENCY eslint@>= 3.1.0
    └─┬ [email protected]
      ├── UNMET PEER DEPENDENCY eslint@>=3.1.0
      └─┬ [email protected]
        ├── [email protected]
        ├─┬ [email protected]
        │ └─┬ [email protected]
        │   ├── [email protected]
        │   └── [email protected]
        ├─┬ [email protected]
        │ └── [email protected]
        └── [email protected]
    
    npm WARN [email protected] requires a peer of eslint@>= 3.1.0 but none was installed.
    npm WARN [email protected] requires a peer of eslint@>=3.1.0 but none was installed.

    Solution is — install eslint-plugin-node separately:

    npm i -g eslint-config-hexo eslint-plugin-node
  2. There are duplicate parameters in eslint.js: dot-notation and no-multi-str. And i also see other parameters which already by default in eslint:recommended settings. Fixed in #6

  3. All 'error' strings can be sucessfully replaced by 2: https://eslint.org/docs/user-guide/configuring#configuring-rules

  4. No need to define parserOptions: { ecmaVersion: 6 } parameter if env: { es6: true } already defined: https://eslint.org/docs/user-guide/configuring#specifying-parser-options

  5. Deprecated parameter 'eqeqeq': ['error', 'allow-null']: https://eslint.org/docs/rules/eqeqeq#allow-null

  6. strict option not needed for ES6, because in ES6 this mode turned on by default.


About pull #6:

  1. no-extra-label now in Best Practices section.
  2. no-mixed-operators now in Stylistic Issues section.
  3. comma-dangle can be just error, never parameter is default for now.
  4. comma-spacing can be just error, before: false, after: true is default for now.
  5. comma-style can be just error, last is default for now.
  6. computed-property-spacing can be just error, never is default for now.
  7. key-spacing can be just error, beforeColon: false, afterColon: true is default for now.
    But i suggest to set {"align": "colon"} parameter.
  8. keyword-spacing can be just error, no needed to set empty ['error', {}] parameters.
  9. linebreak-style can be just error, unix is default for now.
  10. lines-around-comment can be just error, { beforeBlockComment: true } is default for now.
  11. semi can be just error, always is default for now.
  12. semi-spacing can be just error, before: false, after: true is default for now.
  13. space-before-blocks can be just error, always is default for now.
  14. space-before-function-paren can be just error, always is default for now.
  15. space-in-parens can be just error, never is default for now.
  16. spaced-comment can be just error, always is default for now.
  17. template-tag-spacing can be just error, never is default for now.
  18. unicode-bom can be just error, never is default for now.
  19. rest-spread-spacing can be just error, never is default for now.
  20. template-curly-spacing can be just error, never is default for now.
  21. yield-star-spacing can be just error, after is default for now.
  22. yoda can be just error, never is default for now.

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.