Skip to content

Releases: mysticatea/eslint-plugin-node

v4.2.0

06 Mar 20:30
v4.2.0
242eeeb
Compare
Choose a tag to compare

Deprecate a rule

Bug fixes

v4.1.0

23 Feb 09:29
v4.1.0
3f03d92
Compare
Choose a tag to compare

New rules

  • c289f18 added no-hide-core-modules rule.
    This rule disallows require() expressions and import declarations if those import a third-party module which has the same name as core modules. Especially, if you depend on such modules indirectly and npm flattens dependencies, you can depend on such third-party modules before as you know it. This might cause unintentional behaviors.

Enhancements

Bug fixes

  • 17c8ae0 fixed the behavior of no-deprecated-api rule about indirect dependencies. The no-deprecated-api rule has ignored deprecated APIs if a code imports the third-party module which has same name as a core module. However, I found it can cause confusing because of indirect dependencies and flatting dependencies.
    Now, The no-deprecated-api rule does not ignore deprecated APIs even if a code imports the third-party module which has same name as a core module except it's in your package.json explicitly.
    If you want to revive old behavior, please set ignoreIndirectDependencies: true option.

v4.0.1

09 Feb 08:53
v4.0.1
1c12cae
Compare
Choose a tag to compare

Bug fixes

  • 2991302 fixed the error message of no-deprecated-api about new Buffer() and Buffer(). Buffer.alloc and Buffer.from are supported since Node 4.5.0.
    Thank you, @feross !

v4.0.0

05 Feb 20:27
v4.0.0
5fdb19a
Compare
Choose a tag to compare

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

v3.0.5

01 Dec 02:41
v3.0.5
8fd03ed
Compare
Choose a tag to compare

Bug fixes

  • 143f509 fixed the false positive of no-unsupported-features rule about block-scoped functions and ES modules (#59).

v3.0.4

18 Nov 14:37
v3.0.4
0714d40
Compare
Choose a tag to compare

Bug Fixes

  • 8275cfc fixed node/no-unsupported-features rule to not crash if only ignores option was given (version option was omitted).

v3.0.3

01 Nov 11:27
v3.0.3
cb96b14
Compare
Choose a tag to compare

Bug Fixes

  • 1bc22af fixed the false positive of no-deprecated-api rule on Mac/Linux.
    Thank you, @ponko2 !

v3.0.2

01 Nov 09:48
v3.0.2
77d0c76
Compare
Choose a tag to compare

No change.

I had published 2.1.4 to the latest tag.
This release recovers the releasing mistake.

v3.0.1

01 Nov 09:10
v3.0.1
6bbee16
Compare
Choose a tag to compare

Bug Fixes

v2.1.4

01 Nov 09:45
v2.1.4
49f752b
Compare
Choose a tag to compare

This cherry-picked 2 bug fixes from 3.x.

Bug Fixes

  • 292e8f8 fixed a false positive of no-unsupported-features about Unicode code point escapes.
  • 610b905 fixed no-deprecated-api crashing on assignments to undefined variables. (#55)