Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update @mysticatea/eslint-plugin to latest #307

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions lib/rules/callback-return.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,24 @@

module.exports = {
meta: {
type: "suggestion",
docs: {
description: "require `return` statements after callbacks",
category: "Stylistic Issues",
recommended: false,
url:
"https://github.com/mysticatea/eslint-plugin-node/blob/v11.1.0/docs/rules/callback-return.md",
},
fixable: null,
messages: {
missingReturn: "Expected return with your callback function.",
},
schema: [
{
type: "array",
items: { type: "string" },
},
],
fixable: null,
messages: {
missingReturn: "Expected return with your callback function.",
},
type: "suggestion",
},

create(context) {
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/exports-style.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ module.exports = {
url:
"https://github.com/mysticatea/eslint-plugin-node/blob/v11.1.0/docs/rules/exports-style.md",
},
type: "suggestion",
fixable: null,
schema: [
{
Expand All @@ -161,6 +160,7 @@ module.exports = {
additionalProperties: false,
},
],
type: "suggestion",
},

create(context) {
Expand Down
4 changes: 2 additions & 2 deletions lib/rules/global-require.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ function isShadowed(scope, node) {

module.exports = {
meta: {
type: "suggestion",
docs: {
description:
"require `require()` calls to be placed at top-level module scope",
Expand All @@ -59,10 +58,11 @@ module.exports = {
"https://github.com/mysticatea/eslint-plugin-node/blob/v11.1.0/docs/rules/global-require.md",
},
fixable: null,
schema: [],
messages: {
unexpected: "Unexpected require().",
},
schema: [],
type: "suggestion",
},

create(context) {
Expand Down
8 changes: 4 additions & 4 deletions lib/rules/handle-callback-err.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

module.exports = {
meta: {
type: "suggestion",
docs: {
description: "require error handling in callbacks",
category: "Possible Errors",
Expand All @@ -15,14 +14,15 @@ module.exports = {
"https://github.com/mysticatea/eslint-plugin-node/blob/v11.1.0/docs/rules/handle-callback-err.md",
},
fixable: null,
messages: {
expected: "Expected error to be handled.",
},
schema: [
{
type: "string",
},
],
messages: {
expected: "Expected error to be handled.",
},
type: "suggestion",
},

create(context) {
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/no-callback-literal.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ module.exports = {
url:
"https://github.com/mysticatea/eslint-plugin-node/blob/v11.1.0/docs/rules/no-callback-literal.md",
},
type: "problem",
fixable: null,
schema: [],
type: "problem",
},

create(context) {
Expand Down
6 changes: 3 additions & 3 deletions lib/rules/no-deprecated-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -659,8 +659,8 @@ function toName(type, path) {
return type === ReferenceTracker.CALL
? `${baseName}()`
: type === ReferenceTracker.CONSTRUCT
? `new ${baseName}()`
: baseName
? `new ${baseName}()`
: baseName
}

/**
Expand Down Expand Up @@ -688,7 +688,6 @@ module.exports = {
url:
"https://github.com/mysticatea/eslint-plugin-node/blob/v11.1.0/docs/rules/no-deprecated-api.md",
},
type: "problem",
fixable: null,
schema: [
{
Expand Down Expand Up @@ -720,6 +719,7 @@ module.exports = {
additionalProperties: false,
},
],
type: "problem",
},
create(context) {
const {
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/no-extraneous-import.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ module.exports = {
url:
"https://github.com/mysticatea/eslint-plugin-node/blob/v11.1.0/docs/rules/no-extraneous-import.md",
},
type: "problem",
fixable: null,
schema: [
{
Expand All @@ -35,6 +34,7 @@ module.exports = {
additionalProperties: false,
},
],
type: "problem",
},
create(context) {
const filePath = context.getFilename()
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/no-extraneous-require.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ module.exports = {
url:
"https://github.com/mysticatea/eslint-plugin-node/blob/v11.1.0/docs/rules/no-extraneous-require.md",
},
type: "problem",
fixable: null,
schema: [
{
Expand All @@ -35,6 +34,7 @@ module.exports = {
additionalProperties: false,
},
],
type: "problem",
},
create(context) {
const filePath = context.getFilename()
Expand Down
4 changes: 2 additions & 2 deletions lib/rules/no-hide-core-modules.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ const BACK_SLASH = /\\/gu

module.exports = {
meta: {
deprecated: true,
docs: {
description:
"disallow third-party modules which are hiding core modules",
Expand All @@ -58,8 +59,6 @@ module.exports = {
url:
"https://github.com/mysticatea/eslint-plugin-node/blob/v11.1.0/docs/rules/no-hide-core-modules.md",
},
type: "problem",
deprecated: true,
fixable: null,
schema: [
{
Expand All @@ -77,6 +76,7 @@ module.exports = {
additionalProperties: false,
},
],
type: "problem",
},
create(context) {
if (context.getFilename() === "<input>") {
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/no-missing-import.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ module.exports = {
url:
"https://github.com/mysticatea/eslint-plugin-node/blob/v11.1.0/docs/rules/no-missing-import.md",
},
type: "problem",
fixable: null,
schema: [
{
Expand All @@ -33,6 +32,7 @@ module.exports = {
additionalProperties: false,
},
],
type: "problem",
},
create(context) {
const filePath = context.getFilename()
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/no-missing-require.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ module.exports = {
url:
"https://github.com/mysticatea/eslint-plugin-node/blob/v11.1.0/docs/rules/no-missing-require.md",
},
type: "problem",
fixable: null,
schema: [
{
Expand All @@ -33,6 +32,7 @@ module.exports = {
additionalProperties: false,
},
],
type: "problem",
},
create(context) {
const filePath = context.getFilename()
Expand Down
12 changes: 6 additions & 6 deletions lib/rules/no-mixed-requires.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ const BUILTIN_MODULES = [

module.exports = {
meta: {
type: "suggestion",
docs: {
description:
"disallow `require` calls to be mixed with regular variable declarations",
Expand All @@ -77,6 +76,11 @@ module.exports = {
"https://github.com/mysticatea/eslint-plugin-node/blob/v11.1.0/docs/rules/no-mixed-requires.md",
},
fixable: null,
messages: {
noMixRequire: "Do not mix 'require' and other declarations.",
noMixCoreModuleFileComputed:
"Do not mix core, module, file and computed requires.",
},
schema: [
{
oneOf: [
Expand All @@ -98,11 +102,7 @@ module.exports = {
],
},
],
messages: {
noMixRequire: "Do not mix 'require' and other declarations.",
noMixCoreModuleFileComputed:
"Do not mix core, module, file and computed requires.",
},
type: "suggestion",
},

create(context) {
Expand Down
4 changes: 2 additions & 2 deletions lib/rules/no-new-require.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

module.exports = {
meta: {
type: "suggestion",
docs: {
description: "disallow `new` operators with calls to `require`",
category: "Possible Errors",
Expand All @@ -15,10 +14,11 @@ module.exports = {
"https://github.com/mysticatea/eslint-plugin-node/blob/v11.1.0/docs/rules/no-new-require.md",
},
fixable: null,
schema: [],
messages: {
noNewRequire: "Unexpected use of new with require.",
},
schema: [],
type: "suggestion",
},

create(context) {
Expand Down
4 changes: 2 additions & 2 deletions lib/rules/no-path-concat.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ function isConcat(node, sepNodes, globalScope) {

module.exports = {
meta: {
type: "suggestion",
docs: {
description:
"disallow string concatenation with `__dirname` and `__filename`",
Expand All @@ -168,11 +167,12 @@ module.exports = {
"https://github.com/mysticatea/eslint-plugin-node/blob/v11.1.0/docs/rules/no-path-concat.md",
},
fixable: null,
schema: [],
messages: {
usePathFunctions:
"Use path.join() or path.resolve() instead of string concatenation.",
},
schema: [],
type: "suggestion",
},

create(context) {
Expand Down
4 changes: 2 additions & 2 deletions lib/rules/no-process-env.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

module.exports = {
meta: {
type: "suggestion",
docs: {
description: "disallow the use of `process.env`",
category: "Stylistic Issues",
Expand All @@ -19,10 +18,11 @@ module.exports = {
"https://github.com/mysticatea/eslint-plugin-node/blob/v11.1.0/docs/rules/no-process-env.md",
},
fixable: null,
schema: [],
messages: {
unexpectedProcessEnv: "Unexpected use of process.env.",
},
schema: [],
type: "suggestion",
},

create(context) {
Expand Down
4 changes: 2 additions & 2 deletions lib/rules/no-process-exit.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

module.exports = {
meta: {
type: "suggestion",
docs: {
description: "disallow the use of `process.exit()`",
category: "Possible Errors",
Expand All @@ -15,10 +14,11 @@ module.exports = {
"https://github.com/mysticatea/eslint-plugin-node/blob/v11.1.0/docs/rules/no-process-exit.md",
},
fixable: null,
schema: [],
messages: {
noProcessExit: "Don't use process.exit(); throw an error instead.",
},
schema: [],
type: "suggestion",
},

create(context) {
Expand Down
12 changes: 6 additions & 6 deletions lib/rules/no-restricted-import.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ const visit = require("../util/visit-import")

module.exports = {
meta: {
type: "suggestion",
docs: {
description:
"disallow specified modules when loaded by `import` declarations",
Expand All @@ -19,6 +18,11 @@ module.exports = {
"https://github.com/mysticatea/eslint-plugin-node/blob/v11.1.0/docs/rules/no-restricted-import.md",
},
fixable: null,
messages: {
restricted:
// eslint-disable-next-line @mysticatea/eslint-plugin/report-message-format
"'{{name}}' module is restricted from being used.{{customMessage}}",
},
schema: [
{
type: "array",
Expand Down Expand Up @@ -48,11 +52,7 @@ module.exports = {
additionalItems: false,
},
],
messages: {
restricted:
// eslint-disable-next-line @mysticatea/eslint-plugin/report-message-format
"'{{name}}' module is restricted from being used.{{customMessage}}",
},
type: "suggestion",
},

create(context) {
Expand Down
Loading