forked from mysticatea/eslint-plugin-node
-
-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
46 changed files
with
589 additions
and
549 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: "\U0001F680 Request a change (not rule-related)" | ||
description: "Request a change that is not a bug fix, rule change, or new rule" | ||
title: "Change Request: (fill in)" | ||
labels: | ||
- enhancement | ||
- core | ||
body: | ||
- type: markdown | ||
attributes: | ||
value: By opening an issue, you agree to abide by the [Open JS Foundation Code of Conduct](https://eslint.org/conduct). | ||
- type: input | ||
attributes: | ||
label: eslint-plugin-n version | ||
description: | | ||
What version of eslint-plugin-n are you currently using? | ||
placeholder: | | ||
e.g. v16.0.0 | ||
validations: | ||
required: true | ||
- type: textarea | ||
attributes: | ||
label: What problem do you want to solve? | ||
description: | | ||
Please explain your use case in as much detail as possible. | ||
placeholder: | | ||
ESLint currently... | ||
validations: | ||
required: true | ||
- type: textarea | ||
attributes: | ||
label: What do you think is the correct solution? | ||
description: | | ||
Please explain how you'd like to change to address the problem. | ||
placeholder: | | ||
I'd like to... | ||
validations: | ||
required: true | ||
- type: checkboxes | ||
attributes: | ||
label: Participation | ||
options: | ||
- label: I am willing to submit a pull request for this change. | ||
required: false | ||
- type: textarea | ||
attributes: | ||
label: Additional comments | ||
description: Is there anything else that's important for the team to know? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
registry=https://registry.npmjs.org/ | ||
registry = https://registry.npmjs.org/ | ||
package-lock = false | ||
force = true | ||
legacy-peer-deps = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/** | ||
* @fileoverview Helpers for tests. | ||
* @author 唯然<[email protected]> | ||
*/ | ||
"use strict" | ||
const eslintVersion = require("eslint/package.json").version | ||
const { RuleTester } = require("eslint") | ||
const { FlatRuleTester } = require("eslint/use-at-your-own-risk") | ||
const globals = require("globals") | ||
const semverSatisfies = require("semver/functions/satisfies") | ||
|
||
// greater than or equal to ESLint v9 | ||
exports.gteEslintV9 = semverSatisfies(eslintVersion, ">=9", { | ||
includePrerelease: true, | ||
}) | ||
|
||
exports.FlatRuleTester = exports.gteEslintV9 ? RuleTester : FlatRuleTester | ||
|
||
// to support the `env:{ es6: true, node: true}` rule-tester (env has been away in flat config.) | ||
// * enabled by default as it's most commonly used in the package. | ||
// * to disable the node.js globals: {languageOptions: {env: {node: false}}}. | ||
const defaultConfig = { | ||
languageOptions: { | ||
ecmaVersion: 6, | ||
sourceType: "commonjs", | ||
globals: globals.node, | ||
}, | ||
} | ||
exports.RuleTester = function (config = defaultConfig) { | ||
if (config.languageOptions.env?.node === false) | ||
config.languageOptions.globals = config.languageOptions.globals || {} | ||
delete config.languageOptions.env | ||
|
||
config.languageOptions = Object.assign( | ||
{}, | ||
defaultConfig.languageOptions, | ||
config.languageOptions | ||
) | ||
|
||
const ruleTester = new exports.FlatRuleTester(config) | ||
return ruleTester | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.