包详细信息

@colony/eslint-config-colony

JoinColony995MIT10.0.0

eslint configuration for Colony projects

eslint, config

自述文件

eslint-config-colony

The eslint configuration used for Colony OSS projects. Instructions copied from eslint-config-airbnb

Usage

Our default export contains all of our ESLint rules.

Requirements

  • eslint
  • babel-eslint
  • eslint-config-airbnb-base
  • eslint-config-prettier
  • eslint-plugin-import
  • eslint-plugin-prettier
  • prettier

If you use yarn, run npm info "@colony/eslint-config-colony@latest" peerDependencies to list the peer dependencies and versions, then run yarn add --dev <dependency>@<version> for each listed peer dependency. See below for npm instructions.

  1. Install the correct versions of each package, which are listed by the command:

    npm info "@colony/eslint-config-colony@latest" peerDependencies
    

    If using npm 5+, use this shortcut

    npx install-peerdeps --dev @colony/eslint-config-colony
    

    If using yarn, you can also use the shortcut described above if you have npm 5+ installed on your machine, as the command will detect that you are using yarn and will act accordingly. Otherwise, run npm info "@colony/eslint-config-colony@latest" peerDependencies to list the peer dependencies and versions, then run yarn add --dev <dependency>@<version> for each listed peer dependency.

    If using npm < 5, Linux/OSX users can run

    (
     export PKG=@colony/eslint-config-colony;
     npm info "$PKG@latest" peerDependencies --json | command sed 's/[\{\},]//g ; s/: /@/g' | xargs npm install --save-dev "$PKG@latest"
    )
    

    Which produces and runs a command like:

    npm install --save-dev @colony/eslint-config-colony eslint@^#.#.# eslint-plugin-import@^#.#.#
    

    If using npm < 5, Windows users can either install all the peer dependencies manually, or use the install-peerdeps cli tool.

    npm install -g install-peerdeps
    install-peerdeps --dev @colony/eslint-config-colony
    

    The cli will produce and run a command like:

    npm install --save-dev @colony/eslint-config-colony eslint@^#.#.# eslint-plugin-import@^#.#.#
    
  2. Add "extends": "@colony/eslint-config-colony" to your .eslintrc

更新日志

Changelog

v8.0.1

  • Version mixup, normalize

v8.0.0

  • Remove flow assumption and relevant packages
  • Switch to npm as the package manger
  • Use default parser
  • Add eslint-comments plugin
  • Add exceptions for long import/export statements
  • Use block annotation style for flow annotations

v7.0.0

  • Update "eslint" to 5.8.0
  • Update "eslint-plugin-flowtype" to 3.1.1
  • Update "eslint-plugin-prettier" to 3.0.0
  • Update "flow-bin" to 0.84.0
  • Add 'no-console': ['error', { allow: ['warn', 'error', 'info'] }] rule

v6.0.0

  • Update "babel-eslint" to v10.0.1
  • Update "eslint" to v5.6.0
  • Update "eslint-config-airbnb-base" to v13.1.0
  • Update "eslint-config-prettier" to v3.1.0
  • Update "eslint-plugin-flowtype" to v2.50.1
  • Update "eslint-plugin-import" to v2.14.0
  • Update "eslint-plugin-prettier" to v2.6.2
  • Update "flow-bin" to v0.81.0
  • Update "prettier" to v1.14.3

v5.0.0

  • Update peerDependencies (most notably eslint-airbnb-config-base to v13.0.1)
  • Add dependency to flow-bin
  • Add "no-use-before-define": ["error", { "functions": false, "classes": true }] rule
  • Add "no-warning-comments": ["error", { "terms": ["fixme"], "location": "start" }] rule

v4.0.0

  • Fix peerDependencies (add eslint)
  • Bump peerDependencies versions
  • Add 'flowtype/require-valid-file-annotation': [1, 'always'] rule

Migrating from v3.x

flowtype/require-valid-file-annotation requires you to have flow annotations in all your source files (otherwise it will warn). If you don't use flow this shouldn't concern you.

To disable this rule for certain files (you might want to exclude tests), add this to your .eslintrc file overrides:

"overrides": [
    {
        "files": "*.test.js",
        "rules": {
            "flowtype/require-valid-file-annotation": "off"
        }
    }
]

The pattern *.test.js being an example for matchting your test files.

< v4

This seems to be a great mystery.