yarn eslint-plugin-node 4.0.0

latest releases: 11.1.0, 11.0.0, 10.0.0...
7 years ago

Breaking changes

  • It dropped supports for Node.js 0.x. See also: https://github.com/nodejs/LTS
  • It dropped supports for ESLint 2.x. eslint-plugin-node 4 requires ESLint 3.1.0 or later.

Enhancements

  • f8a5e0b added new option value of convertPath to several rules. This supports excluding files to convert. (#60)
  • 6172870 added new option ignoreModuleItems and ignoreGlobalItems to no-deprecated-api rule. (#58)

convertPath

For example, when you use babel src --out-dir dist --ignore /__tests__/, the following setting would work:

{
    "rules": {
        "node/no-unpublished-import": ["error", {
            "convertPath": [
                {
                    "include": ["src/**/*.js"],
                    "exclude": ["**/__tests__/**/*.js"],
                    "replace": ["^src/(.+)$", "dist/$1"]
                }
            ]
        }]
    }
}

ignoreModuleItems and ignoreGlobalItems

Those options can be used to ignore the use of specific deprecated APIs.
For example, the following setting would ignore Buffer constructors:

{
    "rules": {
        "node/no-deprecated-api": ["error", {
            "ignoreModuleItems": ["new buffer.Buffer()"],
            "ignoreGlobalItems": ["new Buffer()"]
        }]
    }
}

Don't miss a new eslint-plugin-node release

NewReleases is sending notifications on new releases.