Skip to content

Commit

Permalink
chore: eslint to latest
Browse files Browse the repository at this point in the history
  • Loading branch information
aladdin-add committed Nov 27, 2023
1 parent 841f3a6 commit 968349e
Show file tree
Hide file tree
Showing 15 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion lib/rules/file-extension-in-import.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ module.exports = {
type: "suggestion",
},
create(context) {
if ((context.getFilename() ?? context.filename).startsWith("<")) {
if ((context.filename ?? context.getFilename()).startsWith("<")) {
return {}
}
const defaultStyle = context.options[0] || "always"
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 @@ -34,7 +34,7 @@ module.exports = {
messages,
},
create(context) {
const filePath = context.getFilename() ?? context.filename
const filePath = context.filename ?? context.getFilename()
if (filePath === "<input>") {
return {}
}
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 @@ -36,7 +36,7 @@ module.exports = {
messages,
},
create(context) {
const filePath = context.getFilename() ?? context.filename
const filePath = context.filename ?? context.getFilename()
if (filePath === "<input>") {
return {}
}
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 @@ -85,10 +85,10 @@ module.exports = {
},
},
create(context) {
if ((context.getFilename() ?? context.filename) === "<input>") {
if ((context.filename ?? context.getFilename()) === "<input>") {
return {}
}
const filePath = path.resolve(context.getFilename() ?? context.filename)
const filePath = path.resolve(context.filename ?? context.getFilename())
const dirPath = path.dirname(filePath)
const packageJson = getPackageJson(filePath)
const deps = new Set(
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 @@ -36,7 +36,7 @@ module.exports = {
messages,
},
create(context) {
const filePath = context.getFilename() ?? context.filename
const filePath = context.filename ?? context.getFilename()
if (filePath === "<input>") {
return {}
}
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 @@ -38,7 +38,7 @@ module.exports = {
messages,
},
create(context) {
const filePath = context.getFilename() ?? context.filename
const filePath = context.filename ?? context.getFilename()
if (filePath === "<input>") {
return {}
}
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/no-unpublished-bin.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ module.exports = {
return {
Program(node) {
// Check file path.
let rawFilePath = context.getFilename() ?? context.filename
let rawFilePath = context.filename ?? context.getFilename()
if (rawFilePath === "<input>") {
return
}
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/no-unpublished-import.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ module.exports = {
messages,
},
create(context) {
const filePath = context.getFilename() ?? context.filename
const filePath = context.filename ?? context.getFilename()
const options = context.options[0] || {}
const ignoreTypeImport =
options.ignoreTypeImport === void 0
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/no-unpublished-require.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ module.exports = {
messages,
},
create(context) {
const filePath = context.getFilename() ?? context.filename
const filePath = context.filename ?? context.getFilename()
if (filePath === "<input>") {
return {}
}
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/no-unsupported-features.js
Original file line number Diff line number Diff line change
Expand Up @@ -1088,7 +1088,7 @@ module.exports = {
const sourceCode = context.sourceCode ?? context.getSourceCode()
const supportInfo = parseOptions(
context.options[0],
getDefaultVersion(context.getFilename() ?? context.filename)
getDefaultVersion(context.filename ?? context.getFilename())
)

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/shebang.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ module.exports = {
},
create(context) {
const sourceCode = context.sourceCode ?? context.getSourceCode()
let filePath = context.getFilename() ?? context.filename
let filePath = context.filename ?? context.getFilename()
if (filePath === "<input>") {
return {}
}
Expand Down
2 changes: 1 addition & 1 deletion lib/util/get-configured-node-version.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ module.exports = function getConfiguredNodeVersion(context) {
const version =
get(context.options && context.options[0]) ||
get(context.settings && (context.settings.n || context.settings.node))
const filePath = context.getFilename() ?? context.filename
const filePath = context.filename ?? context.getFilename()

return (
getSemverRange(version) ||
Expand Down
2 changes: 1 addition & 1 deletion lib/util/visit-import.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ module.exports = function visitImport(
) {
const targets = []
const basedir = path.dirname(
path.resolve(context.getFilename() ?? context.filename)
path.resolve(context.filename ?? context.getFilename())
)
const paths = getResolvePaths(context, optionIndex)
const extensions = getTryExtensions(context, optionIndex)
Expand Down
2 changes: 1 addition & 1 deletion lib/util/visit-require.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ module.exports = function visitRequire(
) {
const targets = []
const basedir = path.dirname(
path.resolve(context.getFilename() ?? context.filename)
path.resolve(context.filename ?? context.getFilename())
)
const paths = getResolvePaths(context)
const extensions = getTryExtensions(context)
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
},
"devDependencies": {
"@eslint/js": "^8.43.0",
"@types/eslint": "^8.44.2",
"@types/eslint": "^8.44.6",
"@typescript-eslint/parser": "^5.60.0",
"esbuild": "^0.18.7",
"eslint": "^8.47.0",
"eslint": "^8.53.0",
"eslint-config-prettier": "^8.8.0",
"eslint-doc-generator": "^1.4.3",
"eslint-plugin-eslint-plugin": "^5.1.0",
Expand Down

0 comments on commit 968349e

Please sign in to comment.