mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-20 02:08:47 +00:00
Use config to disable rule in tests
This commit is contained in:
@@ -9,11 +9,6 @@ import { TSESTree } from '@typescript-eslint/utils';
|
|||||||
export = new class NoDangerousTypeAssertions implements eslint.Rule.RuleModule {
|
export = new class NoDangerousTypeAssertions implements eslint.Rule.RuleModule {
|
||||||
|
|
||||||
create(context: eslint.Rule.RuleContext): eslint.Rule.RuleListener {
|
create(context: eslint.Rule.RuleContext): eslint.Rule.RuleListener {
|
||||||
// Disable in tests for now
|
|
||||||
if (context.getFilename().includes('.test')) {
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
// Disallow type assertions on object literals: <T>{ ... } or {} as T
|
// Disallow type assertions on object literals: <T>{ ... } or {} as T
|
||||||
['TSTypeAssertion > ObjectExpression, TSAsExpression > ObjectExpression']: (node: any) => {
|
['TSTypeAssertion > ObjectExpression, TSAsExpression > ObjectExpression']: (node: any) => {
|
||||||
|
|||||||
@@ -1108,6 +1108,7 @@ export default tseslint.config(
|
|||||||
'local': pluginLocal,
|
'local': pluginLocal,
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
|
'local/code-no-dangerous-type-assertions': 'off',
|
||||||
'local/code-must-use-super-dispose': 'off',
|
'local/code-must-use-super-dispose': 'off',
|
||||||
'local/code-no-test-only': 'error',
|
'local/code-no-test-only': 'error',
|
||||||
'local/code-no-test-async-suite': 'warn',
|
'local/code-no-test-async-suite': 'warn',
|
||||||
|
|||||||
Reference in New Issue
Block a user