Skip to content

Commit

Permalink
style(lint): cosmetic fix in attributes nameing
Browse files Browse the repository at this point in the history
  • Loading branch information
ala-n committed Jul 12, 2024
1 parent 785fc27 commit 40045dd
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions eslint/src/core/deprecated-class-method.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export interface ESLintDeprecationStaticMethodCfg {
/** Deprecated static method name */
deprecatedMethod: string;
/** Function that returns recommended method */
getReplacemetMethod: (expression: ESTree.CallExpression) => replacementMethodCfg;
getReplacementMethod: (expression: ESTree.CallExpression) => replacementMethodCfg;
}

type StaticMethodNode = ESTree.MemberExpression & Rule.NodeParentExtension;
Expand All @@ -46,7 +46,7 @@ function isDeprecatedMethod(node: StaticMethodNode, config: ESLintDeprecationSta
}

function handleCallExpression(node: StaticMethodNode, context: Rule.RuleContext, config: ESLintDeprecationStaticMethodCfg): void {
const {replacement, message} = config.getReplacemetMethod(node.parent as ESTree.CallExpression);
const {replacement, message} = config.getReplacementMethod(node.parent as ESTree.CallExpression);

context.report({
node,
Expand Down
2 changes: 1 addition & 1 deletion eslint/src/rules/4/deprecated.media-rule-list-parse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import type {replacementMethodCfg} from '../../core/deprecated-class-method';
export default buildRule({
className: 'ESLMediaRuleList',
deprecatedMethod: 'parse',
getReplacemetMethod: (expression): replacementMethodCfg => {
getReplacementMethod: (expression): replacementMethodCfg => {
const args = expression.arguments;
if (expression.type !== 'CallExpression') return {message: 'parseQuery or parseTuple'};
const methodName = args.length === 1 || (args[1]?.type !== 'Literal' && args[1]?.type !== 'TemplateLiteral') ? 'parseQuery' : 'parseTuple';
Expand Down
2 changes: 1 addition & 1 deletion eslint/test/deprecated-class-method.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ describe('ESL Migration Rules: Deprecated Static Method: valid', () => {
const rule = buildRule({
className: 'TestClass',
deprecatedMethod: 'oldMethod',
getReplacemetMethod: (expression) => {
getReplacementMethod: (expression) => {
const args = expression.arguments;
if (args.length === 0) return {message: 'newMethodNoArgs'};

Expand Down

0 comments on commit 40045dd

Please sign in to comment.