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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 馃悰 When using always have a different error message #333

Merged
merged 1 commit into from Mar 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions packages/eslint-plugin/src/rules/interface-name-prefix.ts
@@ -1,7 +1,7 @@
import * as util from '../util';

type Options = ['never' | 'always'];
type MessageIds = 'noPrefix';
type MessageIds = 'noPrefix' | 'alwaysPrefix';

export default util.createRule<Options, MessageIds>({
name: 'interface-name-prefix',
Expand All @@ -15,6 +15,7 @@ export default util.createRule<Options, MessageIds>({
},
messages: {
noPrefix: 'Interface name must not be prefixed with "I".',
alwaysPrefix: 'Interface name must be prefixed with "I".',
},
schema: [
{
Expand Down Expand Up @@ -51,7 +52,7 @@ export default util.createRule<Options, MessageIds>({
if (!isPrefixedWithI(node.id.name)) {
context.report({
node: node.id,
messageId: 'noPrefix',
messageId: 'alwaysPrefix',
});
}
}
Expand Down
Expand Up @@ -77,7 +77,7 @@ interface Animal {
options: ['always'],
errors: [
{
messageId: 'noPrefix',
messageId: 'alwaysPrefix',
line: 2,
column: 11,
},
Expand All @@ -92,7 +92,7 @@ interface Iguana {
options: ['always'],
errors: [
{
messageId: 'noPrefix',
messageId: 'alwaysPrefix',
line: 2,
column: 11,
},
Expand Down