Skip to content
Draft
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
2 changes: 1 addition & 1 deletion lib/rules/jsx-filename-extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ module.exports = {
},

create(context) {
const filename = context.getFilename();
const filename = context.filename;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's probably safer to do this since we still support much older eslint versions?

Suggested change
const filename = context.filename;
const filename = context.filename || context.getFilename();


let jsxNode;

Expand Down
2 changes: 1 addition & 1 deletion lib/util/version.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function resetDetectedVersion() {

function resolveBasedir(contextOrFilename) {
if (contextOrFilename) {
const filename = typeof contextOrFilename === 'string' ? contextOrFilename : contextOrFilename.getFilename();
const filename = typeof contextOrFilename === 'string' ? contextOrFilename : contextOrFilename.filename;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const filename = typeof contextOrFilename === 'string' ? contextOrFilename : contextOrFilename.filename;
const filename = typeof contextOrFilename === 'string' ? contextOrFilename : contextOrFilename.filename || contextOrFileName.getFilename();

const dirname = path.dirname(filename);
try {
if (fs.statSync(filename).isFile()) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"@babel/plugin-syntax-do-expressions": "^7.27.1",
"@babel/plugin-syntax-function-bind": "^7.27.1",
"@babel/preset-react": "^7.27.1",
"@types/eslint": "=7.2.10",
"@types/eslint": "=8.56.12",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we still support eslint 7 so i'm not sure we can upgrade the types - and if we do we'd use ^, not =

"@types/estree": "0.0.52",
"@types/node": "^4.9.5",
"@typescript-eslint/parser": "^2.34.0 || ^3.10.1 || ^4 || ^5 || ^6.20 || ^7.14.1 || 8.4 - 8.17",
Expand Down
Loading