Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added fixes to append public or private keywords #23

Merged
merged 4 commits into from
Nov 25, 2023
Merged
Show file tree
Hide file tree
Changes from 2 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
6 changes: 5 additions & 1 deletion src/rules/own-methods-must-be-private.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ const rule: Rule.RuleModule = {
recommended: true,
},
schema: [],
type: "problem",
type: 'problem',
fixable: 'code',
},

create(context): Rule.RuleListener {
Expand Down Expand Up @@ -44,6 +45,9 @@ const rule: Rule.RuleModule = {
context.report({
node: node,
message: `Own class methods cannot be public`,
fix(fixer) {
return fixer.insertTextBefore(node.key, 'private ');
}
});
}
},
Expand Down
8 changes: 6 additions & 2 deletions src/rules/own-props-must-be-private.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ const rule: Rule.RuleModule = {
recommended: true,
},
schema: [],
type: "problem",
type: 'problem',
fixable: 'code',
},

create(context: any): Rule.RuleListener {
create(context): Rule.RuleListener {
const stencil = stencilComponentContext();

const parserServices = context.parserServices;
Expand All @@ -41,6 +42,9 @@ const rule: Rule.RuleModule = {
context.report({
node: node,
message: `Own class properties cannot be public`,
fix(fixer) {
return fixer.insertTextBefore(node.key, 'private ');
}
});
}
},
Expand Down
Loading