包详细信息

eslint-config-i-am-meticulous

MoOx1.5kMIT12.0.0

An ESLint shareable config for meticulous people.

eslint, eslint-config

自述文件

eslint-config-i-am-meticulous

An ESLint shareable config for meticulous people.

Travis (Unix) Build Badge

Repo on GitHub Repo on GitLab Repo on BitBucket

⚠️ This config does not contain rules for code style. We recommend you to use prettier.

If you have any question about a rule or want to discuss about it, please open an issue.

Install

npm i -D eslint eslint-config-i-am-meticulous

Note that the default config require eslint-plugin-import

Usage

Notes

  • This config extends eslint:recommended.
  • You will need to adjust configuration syntax depending on your configuration location (package.json or .eslintrc).
  • You might need to use babel-eslint if you use babel with fresh ES stages.

Meticulous modern ES

Add to your eslint configuration (here, in package.json)

{
  "eslintConfig": {
    "extends": "eslint-config-i-am-meticulous"
  }
}

Flow

To use the meticulous flow rule set (that extends the default one):

This rule set require babel-eslint.

npm i -D eslint babel-eslint eslint-plugin-flowtype eslint-config-i-am-meticulous
{
  "eslintConfig": {
    "parser": "babel-eslint",
    "extends": "eslint-config-i-am-meticulous/flow"
  }
}

React

To use the meticulous React rule set (that extends the default one):

npm i -D eslint eslint-plugin-react eslint-config-i-am-meticulous
{
  "eslintConfig": {
    "extends": "eslint-config-i-am-meticulous/react"
  }
}

React + Flow

To use the meticulous React + flow rule set (that extends the default one):

This rule set require babel-eslint.

npm i -D eslint babel-eslint eslint-plugin-flowtype eslint-config-i-am-meticulous
{
  "eslintConfig": {
    "parser": "babel-eslint",
    "extends": "eslint-config-i-am-meticulous/react-flow"
  }
}

This rule set is a combination of react and flow rule sets but add a tiny change to support props and state property initializers to be added at the top of classes (react/sort-comp default configuration does not allow that).

React-Native

To use the meticulous React-Native rule set (that extends the default React and Flow ones):

npm i -D eslint eslint-plugin-react eslint-plugin-react-native eslint-plugin-flowtype eslint-config-i-am-meticulous
{
  "eslintConfig": {
    "extends": "eslint-config-i-am-meticulous/react-native"
  }
}

Old ES5

To use the meticulous ES5 rule set (that extends the default one):

npm i -D eslint eslint-plugin-react eslint-config-i-am-meticulous
{
  "eslintConfig": {
    "extends": "eslint-config-i-am-meticulous/es5"
  }
}

CONTRIBUTING

  • ⇄ Pull requests and ★ Stars are always welcome.
  • For bugs and feature requests, please create an issue.
  • Pull requests must be accompanied by passing automated tests ($ npm test).

CHANGELOG

LICENSE

更新日志

Changelog of eslint-config-i-am-meticulous

12.0.0 - 2018-07-19

  • Switch to eslint 6 & friends
  • Removed ava
  • Remove some old Synthetic* globals for flow/react-native
  • Remove all non error rules

11.0.0 - 2018-07-19

  • Switch to eslint 5

10.0.0 - 2018-06-13

  • several too brutal react(-native) rules disabled
  • "react/jsx-boolean-value" on to match ReasonReact style
  • "react/no-this-in-sfc" on

9.0.1 - 2018-06-07

  • Bump dep/devDeps to ensure compat with rules

9.0.0 - 2018-06-07

  • import/no-self-import enabled
  • import/no-useless-path-segments: enabled
  • react/no-did-mount-set-state disabled
  • react/no-did-update-set-state disabled

8.0.0 - 2018-02-09

  • (flowtype/no-unused-expressions) Avoid keeping unused type annotations
  • (flowtype/type-id-match) Remove type naming restriction
  • (flowtype/no-mutable-array) Disallow Array in favor of $ReadOnlyArray
  • (flowtype/require-exact-type) Disallow inexact object types ({| |} notation is required).
  • (react/sort-comp) Allow type annotations and instance variables at the top of React class components

7.0.1 - 2017-09-06

  • react-native correctly extends react-flow

7.0.0 - 2017-09-06

  • Eslint 4+
  • Updated all plugins with new (undefined) rules (some on, some off)
  • Globals to prevent "no-undef" with Flow (ref)

6.0.1 - 2017-04-19

  • Relaxed: flowtype/type-id-match is less strict. It accepts lowercase for the first letter (eg: for function type)

6.0.0 - 2017-03-23

  • Removed: all rules directly related to code styles have been removed. We recommend you to use prettier.
  • Changed: eslint ecmaVersion set to 2017
  • Added: some rules for flow (7a36807 & 98c6bae)

5.0.2 - 2016-09-24

  • Fixed: babel-eslint is not required for the default config

5.0.1 - 2016-09-24

  • Fixed: json files cause too much issue with import plugin, so ignored.

5.0.0 - 2016-09-24

  • Changed: eslint@3 compat
  • Added: lot of missings rules related to package updates (mainly for react)
    • eslint-plugin-react@6
    • eslint-plugin-ava@3
  • Added: eslint-plugin-import is now included in the default config. All rules are on except no-nodejs-modules which depends on the env.
  • Added: react/jsx-first-prop-new-line with multiline value to enforce first prop on a new line if there is multiple props. The following patterns are now considered warnings: multiple props. The following patterns are now considered warnings:

    <Hello personal prop />
    

    The following patterns are now not considered warnings:

    <Hello personal={true} />
    
    <Hello
        personal={true}
        foo="bar"
    />
    
  • Added: react/jsx-no-target-blank. This rules requires that you accompany all target='_blank' attributes with rel='noreferrer noopener' for security reasons.

  • Added: eslint-plugin-react-native available as eslint-config-i-am-meticulous/react-native.

4.2.1 - 2016-04-12

  • Added: react/require-render-return

4.1.1 - 2016-04-11

  • Fixed: as jsx-indent is considered buggy, the rule is for now disabled. If re-enabled, will be done in a major release.

4.1.0 - 2016-03-25

  • Added: react-flow preset. Flow support for props and state property initializers at the top of React classes (so "react/sort-comp" as been adjusted).

4.0.0 - 2016-03-23

New rules added.

  • Changed: All react rules defined, just a few are disabled.
  • Added: AVA rule set (just recommended rule)
  • Added: flow rule set (just recommended rule)

3.0.0 - 2016-02-29

Not changes for rules.

  • Removed: eslint@1.x support
  • Added: eslint@2.x support

2.0.0 - 2016-01-20

  • Removed: "babel-eslint" is not used by default
  • Changed: react preset extends the default, no need to include both now
  • Added: es5 preset

1.0.0 - 2016-01-03

💥