Skip to content

v4.0.0

Compare
Choose a tag to compare
@mysticatea mysticatea released this 05 Feb 20:27
· 227 commits to master since this release
v4.0.0
5fdb19a

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()"]
        }]
    }
}