-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added some basic tests for current cases for naming-convention as it’s very complicated.
- Loading branch information
Showing
7 changed files
with
72 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
const { namingRules } = require('../dist/rules/namingConvention'); | ||
|
||
module.exports = { | ||
plugins: ['@typescript-eslint'], | ||
parser: '@typescript-eslint/parser', | ||
parserOptions: { | ||
ecmaVersion: 'latest', | ||
sourceType: 'module', | ||
project: true, | ||
}, | ||
rules: namingRules, | ||
}; |
13 changes: 13 additions & 0 deletions
13
packages/eslint-config/tests/namingConvention.ts/variables.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/** Booleans */ | ||
// eslint-disable-next-line @typescript-eslint/naming-convention | ||
const badName = true; | ||
const isBadName = true; | ||
const disabled = true; | ||
|
||
/** Dereferencing */ | ||
function SomeComponent({ icon: Icon, command }) { | ||
const { icon: IconComponent } = command; | ||
// eslint-disable-next-line @typescript-eslint/naming-convention | ||
const { other: Other } = command; | ||
const iconComponentRef = null; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"extends": "../tsconfig.json", | ||
"include": ["**/*.ts", "**/*.tsx"], | ||
"compilerOptions": { | ||
"rootDir": ".", | ||
"outDir": "dist", | ||
"paths": {}, | ||
"types": ["vitest"], | ||
"module": "NodeNext", | ||
"resolveJsonModule": true | ||
}, | ||
"exclude": ["node_modules"], | ||
"files": [] | ||
} |