error for I prefixed interface names
Summary: {gif:kosnw403}
Reviewed By: mweststrate
Differential Revision: D33845782
fbshipit-source-id: 2b9bd70e3b2d930e8f4cd8fe7976ac76f43b2496
This commit is contained in:
committed by
Facebook GitHub Bot
parent
a0368a8bbf
commit
75f874a5dd
@@ -0,0 +1,39 @@
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
*/
|
||||
|
||||
import {TSESLint} from '@typescript-eslint/experimental-utils';
|
||||
import rule, {RULE_NAME} from '../noIPrefixInterfaces';
|
||||
|
||||
const tester = new TSESLint.RuleTester({
|
||||
parser: require.resolve('@typescript-eslint/parser'),
|
||||
parserOptions: {
|
||||
sourceType: 'module',
|
||||
ecmaVersion: 2020,
|
||||
},
|
||||
});
|
||||
|
||||
tester.run(RULE_NAME, rule, {
|
||||
valid: [
|
||||
{
|
||||
code: `interface Icon {name: string}`,
|
||||
filename: __filename,
|
||||
},
|
||||
{
|
||||
code: `interface IOSDevice {version: string}`,
|
||||
filename: __filename,
|
||||
},
|
||||
],
|
||||
invalid: [
|
||||
{
|
||||
code: `interface IDevice {version: string;}`,
|
||||
filename: __filename,
|
||||
errors: [{messageId: 'noTsInterfacePrefixI'}],
|
||||
},
|
||||
],
|
||||
});
|
||||
Reference in New Issue
Block a user