Skip to content

Commit 02e795e

Browse files
committed
Consistent type imports and exports in AGTree
Merge in ADGUARD-FILTERS/tsurlfilter from fix/agtree-type-imports to master Squashed commit of the following: commit 146385b Merge: 62a3415 fd3ec59 Author: scripthunter7 <[email protected]> Date: Thu Aug 10 09:31:51 2023 +0200 Merge branch 'master' into fix/agtree-type-imports commit 62a3415 Author: scripthunter7 <[email protected]> Date: Wed Aug 9 12:25:29 2023 +0200 Fix linter errors commit 755feac Author: scripthunter7 <[email protected]> Date: Wed Aug 9 12:24:53 2023 +0200 Update ESLint config
1 parent fd3ec59 commit 02e795e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+138
-124
lines changed

packages/agtree/.eslintrc.cjs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,5 +67,18 @@ module.exports = {
6767
],
6868
'arrow-body-style': 'off',
6969
'no-await-in-loop': 'off',
70+
// Force proper import and export of types
71+
'@typescript-eslint/consistent-type-imports': [
72+
'error',
73+
{
74+
fixStyle: 'inline-type-imports',
75+
},
76+
],
77+
'@typescript-eslint/consistent-type-exports': [
78+
'error',
79+
{
80+
fixMixedExportsWithInlineTypeSpecifier: true,
81+
},
82+
],
7083
},
7184
};

packages/agtree/src/ast-utils/modifiers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import cloneDeep from 'clone-deep';
66

7-
import { Modifier, ModifierList } from '../parser/common';
7+
import { type Modifier, type ModifierList } from '../parser/common';
88
import { isUndefined } from '../utils/common';
99

1010
/**

packages/agtree/src/ast-utils/scriptlets.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
import cloneDeep from 'clone-deep';
66

7-
import { ParameterList } from '../parser/common';
8-
import { QuoteType, setStringQuoteType } from '../utils/quotes';
7+
import { type ParameterList } from '../parser/common';
8+
import { type QuoteType, setStringQuoteType } from '../utils/quotes';
99

1010
/**
1111
* Get name of the scriptlet from the scriptlet node

packages/agtree/src/converter/base-interfaces/rule-converter-base.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
/* eslint-disable @typescript-eslint/no-unused-vars */
1010

1111
import { NotImplementedError } from '../../errors/not-implemented-error';
12-
import { Node } from '../../parser/common';
12+
import { type Node } from '../../parser/common';
1313
import { ConverterBase } from './converter-base';
1414

1515
/**

packages/agtree/src/converter/comment/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import cloneDeep from 'clone-deep';
66

7-
import { AnyCommentRule, CommentMarker, CommentRuleType } from '../../parser/common';
7+
import { type AnyCommentRule, CommentMarker, CommentRuleType } from '../../parser/common';
88
import { SPACE } from '../../utils/constants';
99
import { RuleConverterBase } from '../base-interfaces/rule-converter-base';
1010

packages/agtree/src/converter/cosmetic/css.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
*/
44

55
import cloneDeep from 'clone-deep';
6-
import { SelectorList, fromPlainObject } from '@adguard/ecss-tree';
6+
import { type SelectorList, fromPlainObject } from '@adguard/ecss-tree';
77

8-
import { CosmeticRuleSeparator, CssInjectionRule } from '../../parser/common';
8+
import { CosmeticRuleSeparator, type CssInjectionRule } from '../../parser/common';
99
import { RuleConverterBase } from '../base-interfaces/rule-converter-base';
1010
import { CssSelectorConverter } from '../css';
1111
import { AdblockSyntax } from '../../utils/adblockers';

packages/agtree/src/converter/cosmetic/element-hiding.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
*/
44

55
import cloneDeep from 'clone-deep';
6-
import { SelectorList, fromPlainObject } from '@adguard/ecss-tree';
6+
import { type SelectorList, fromPlainObject } from '@adguard/ecss-tree';
77

8-
import { CosmeticRuleSeparator, ElementHidingRule } from '../../parser/common';
8+
import { CosmeticRuleSeparator, type ElementHidingRule } from '../../parser/common';
99
import { CssTree } from '../../utils/csstree';
1010
import { RuleConverterBase } from '../base-interfaces/rule-converter-base';
1111
import { CssSelectorConverter } from '../css';

packages/agtree/src/converter/cosmetic/html.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
* @file HTML filtering rule converter
33
*/
44

5-
import { SelectorPlain } from '@adguard/ecss-tree';
5+
import { type SelectorPlain } from '@adguard/ecss-tree';
66
import cloneDeep from 'clone-deep';
77

88
import {
99
CosmeticRuleSeparator,
1010
CosmeticRuleType,
11-
HtmlFilteringRule,
11+
type HtmlFilteringRule,
1212
RuleCategory,
1313
} from '../../parser/common';
1414
import { AdblockSyntax } from '../../utils/adblockers';

packages/agtree/src/converter/cosmetic/rule-modifiers/adg.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
* @file Cosmetic rule modifier converter from uBO to ADG
33
*/
44

5-
import { ModifierList } from '../../../parser/common';
5+
import { type ModifierList } from '../../../parser/common';
66
import { RuleConversionError } from '../../../errors/rule-conversion-error';
7-
import { ConverterFunction } from '../../base-interfaces/converter-function';
7+
import { type ConverterFunction } from '../../base-interfaces/converter-function';
88
import { createModifierListNode, createModifierNode } from '../../../ast-utils/modifiers';
99
import { RegExpUtils } from '../../../utils/regexp';
1010
import {

packages/agtree/src/converter/cosmetic/scriptlet.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import cloneDeep from 'clone-deep';
66

7-
import { CosmeticRuleSeparator, ParameterList, ScriptletInjectionRule } from '../../parser/common';
7+
import { CosmeticRuleSeparator, type ParameterList, type ScriptletInjectionRule } from '../../parser/common';
88
import { RuleConverterBase } from '../base-interfaces/rule-converter-base';
99
import { AdgScriptletConverter } from './scriptlets/adg';
1010
import { AdblockSyntax } from '../../utils/adblockers';

0 commit comments

Comments
 (0)