Skip to content

Commit

Permalink
[#43] 👽️ Update deprecated interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
yongholeeme committed Nov 25, 2024
1 parent 5819259 commit 363f33b
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 12 deletions.
7 changes: 4 additions & 3 deletions packages/eslint-plugin/lib/rules/memo-react-components.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import {getExportDefaultDeclaration} from '@naverpay/ast-parser'
import {minimatch} from 'minimatch'

/**
* @type {import('eslint').Rule.RuleModule}
*/
export default {
meta: {
type: 'suggestion',
Expand All @@ -20,9 +23,7 @@ export default {
],
},
create: function (context) {
const rawFilename = context.getFilename()
const cwd = context.getCwd()
const filename = rawFilename.replace(cwd, '')
const filename = context.filename.replace(context.cwd, '')

const isMatched = context.options[0].path.some((pattern) => minimatch(filename, pattern))

Expand Down
4 changes: 1 addition & 3 deletions packages/eslint-plugin/lib/rules/optimize-svg-components.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,7 @@ export default {
],
},
create: function (context) {
const rawFilename = context.getFilename()
const cwd = context.getCwd()
const filenameWithPath = rawFilename.replace(cwd, '')
const filenameWithPath = context.filename.replace(context.cwd, '')

const [filename] = filenameWithPath.split('/').reverse()

Expand Down
3 changes: 3 additions & 0 deletions packages/eslint-plugin/lib/rules/prevent-default-import.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ const fixDefaultToNamedImport = ({fixer, memberName, importDefaultSpecifier, imp
return fixed
}

/**
* @type {import('eslint').Rule.RuleModule}
*/
export default {
meta: {
type: 'problem',
Expand Down
4 changes: 1 addition & 3 deletions packages/eslint-plugin/lib/rules/sort-exports.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,7 @@ export default {
],
},
create: function (context) {
const rawFileName = context.getFilename()
const cwd = context.getCwd()
const filename = rawFileName.replace(cwd, '')
const filename = context.filename.replace(context.cwd, '')
const {
options: [config],
} = context
Expand Down
4 changes: 1 addition & 3 deletions packages/eslint-plugin/lib/rules/svg-unique-id.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,7 @@ export default {
],
},
create: function (context) {
const rawFileName = context.getFilename()
const cwd = context.getCwd()
const filename = rawFileName.replace(cwd, '')
const filename = context.filename.replace(context.cwd, '')
const {
options: [config],
} = context
Expand Down

0 comments on commit 363f33b

Please sign in to comment.