Skip to content

Commit

Permalink
chore: fix ESLint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelDeBoey committed Dec 18, 2021
1 parent a2f0dd3 commit 213b3aa
Show file tree
Hide file tree
Showing 17 changed files with 32 additions and 27 deletions.
15 changes: 15 additions & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,18 @@ root: true
extends:
- plugin:@mysticatea/es2015
- plugin:@mysticatea/+eslint-plugin

overrides:
- files: [ "lib/utils.js", "scripts/*.js" ]
rules:
"@mysticatea/node/no-sync": off

- files:
[
"lib/configs.js",
"lib/foreign-rules/ts.js",
"lib/processors.js",
"lib/rules.js",
]
rules:
"@mysticatea/node/global-require": off
5 changes: 2 additions & 3 deletions tests/lib/configs/_rules.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const {
ConfigArrayFactory,
} = require("eslint/lib/cli-engine/config-array-factory")
const Validator = require("eslint/lib/shared/config-validator")
const { rules: removedRules } = require("eslint/conf/replacements.json")
const { rules: PluginRulesIndex } = require("@mysticatea/eslint-plugin")

const coreRules = new Linter().getRules()
Expand All @@ -25,9 +26,7 @@ const deprecatedRuleNames = new Set(
.filter(([, rule]) => rule && rule.meta && rule.meta.deprecated)
.map(([ruleId]) => ruleId)
)
const removedRuleNames = new Set(
Object.keys(require("eslint/conf/replacements.json").rules)
)
const removedRuleNames = new Set(Object.keys(removedRules))

const configFactory = new ConfigArrayFactory()

Expand Down
3 changes: 1 addition & 2 deletions tests/lib/configs/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@
*/
"use strict"

const config = require("../../../lib/configs/+browser")
const Rules = require("./_rules")

describe("'+browser.js'", () => {
const config = require("../../../lib/configs/+browser")

it("should be a valid config.", () => {
Rules.validateConfig(config, "+browser.js")
})
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/configs/es2015.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"use strict"

const assert = require("assert")
const config = require("../../../lib/configs/es2015")
const Rules = require("./_rules")

/**
Expand All @@ -22,7 +23,6 @@ function isES6Rule(ruleId) {
}

describe("'es2015.js'", () => {
const config = require("../../../lib/configs/es2015")
const configuredRules = Rules.getRulesOfConfig(config, "es2015")
const existingRules = Rules.getCoreRuleNames()

Expand Down
3 changes: 1 addition & 2 deletions tests/lib/configs/es2016.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@
*/
"use strict"

const config = require("../../../lib/configs/es2016")
const Rules = require("./_rules")

describe("'es2016.js'", () => {
const config = require("../../../lib/configs/es2016")

it("should be a valid config.", () => {
Rules.validateConfig(config, "es2016.js")
})
Expand Down
3 changes: 1 addition & 2 deletions tests/lib/configs/es2017.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@
*/
"use strict"

const config = require("../../../lib/configs/es2017")
const Rules = require("./_rules")

describe("'es2017.js'", () => {
const config = require("../../../lib/configs/es2017")

it("should be a valid config.", () => {
Rules.validateConfig(config, "es2017.js")
})
Expand Down
3 changes: 1 addition & 2 deletions tests/lib/configs/es2018.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@
*/
"use strict"

const config = require("../../../lib/configs/es2018")
const Rules = require("./_rules")

describe("'es2018.js'", () => {
const config = require("../../../lib/configs/es2018")

it("should be a valid config.", () => {
Rules.validateConfig(config, "es2018.js")
})
Expand Down
3 changes: 1 addition & 2 deletions tests/lib/configs/es2019.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@
*/
"use strict"

const config = require("../../../lib/configs/es2019")
const Rules = require("./_rules")

describe("'es2019.js'", () => {
const config = require("../../../lib/configs/es2019")

it("should be a valid config.", () => {
Rules.validateConfig(config, "es2019.js")
})
Expand Down
3 changes: 1 addition & 2 deletions tests/lib/configs/es2020.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@
*/
"use strict"

const config = require("../../../lib/configs/es2020")
const Rules = require("./_rules")

describe("'es2020.js'", () => {
const config = require("../../../lib/configs/es2020")

it("should be a valid config.", () => {
Rules.validateConfig(config, "es2020.js")
})
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/configs/es5.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"use strict"

const assert = require("assert")
const config = require("../../../lib/configs/es5")
const Rules = require("./_rules")

/**
Expand All @@ -22,7 +23,6 @@ function isES6Rule(ruleId) {
}

describe("'es5.js'", () => {
const config = require("../../../lib/configs/es5")
const configuredRules = Rules.getRulesOfConfig(config, "es5")
const existingRules = [].concat(
Rules.getCoreRuleNames(),
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/configs/eslint-plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
"use strict"

const assert = require("assert")
const config = require("../../../lib/configs/+eslint-plugin")
const Rules = require("./_rules")

describe("'+eslint-plugin.js'", () => {
const config = require("../../../lib/configs/+eslint-plugin")
const configuredRules = Rules.getRulesOfConfig(config, "+eslint-plugin")
const existingRules = Rules.getPluginRuleNames("eslint-plugin")

Expand Down
3 changes: 1 addition & 2 deletions tests/lib/configs/mocha.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@
*/
"use strict"

const config = require("../../../lib/configs/_override-mocha")
const Rules = require("./_rules")

describe("'mocha.js'", () => {
const config = require("../../../lib/configs/_override-mocha")

it("should be a valid config.", () => {
Rules.validateConfig(config, "mocha.js")
})
Expand Down
3 changes: 1 addition & 2 deletions tests/lib/configs/modules.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@
*/
"use strict"

const config = require("../../../lib/configs/+modules")
const Rules = require("./_rules")

describe("'+modules.js'", () => {
const config = require("../../../lib/configs/+modules")

it("should be a valid config.", () => {
Rules.validateConfig(config, "+modules.js")
})
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/configs/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
"use strict"

const assert = require("assert")
const config = require("../../../lib/configs/+node")
const Rules = require("./_rules")

describe("'+node.js'", () => {
const config = require("../../../lib/configs/+node")
const configuredRules = Rules.getRulesOfConfig(config, "+node")
const existingRules = Rules.getPluginRuleNames("node")

Expand Down
3 changes: 1 addition & 2 deletions tests/lib/configs/special.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@
*/
"use strict"

const config = require("../../../lib/configs/_override-special")
const Rules = require("./_rules")

describe("'special.js'", () => {
const config = require("../../../lib/configs/_override-special")

it("should be a valid config.", () => {
Rules.validateConfig(config, "special.js")
})
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/configs/ts.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
"use strict"

const assert = require("assert")
const config = require("../../../lib/configs/_override-ts")
const Rules = require("./_rules")

describe("'ts.js'", () => {
const config = require("../../../lib/configs/_override-ts")
const configuredRules = Rules.getRulesOfConfig(config, "_override-ts")
const existingRules = Rules.getPluginRuleNames("ts")

Expand Down
2 changes: 1 addition & 1 deletion tests/lib/configs/vue.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
"use strict"

const assert = require("assert")
const config = require("../../../lib/configs/_override-vue")
const Rules = require("./_rules")

describe("'vue.js'", () => {
const config = require("../../../lib/configs/_override-vue")
const configuredRules = Rules.getRulesOfConfig(config, "_override-ts")
const existingRules = Rules.getPluginRuleNames("vue")

Expand Down

0 comments on commit 213b3aa

Please sign in to comment.