[6a3a178] | 1 | import { Linter } from "../index";
|
---|
| 2 |
|
---|
| 3 | export interface Variables extends Linter.RulesRecord {
|
---|
| 4 | /**
|
---|
| 5 | * Rule to require or disallow initialization in variable declarations.
|
---|
| 6 | *
|
---|
| 7 | * @since 1.0.0-rc-1
|
---|
| 8 | * @see https://eslint.org/docs/rules/init-declarations
|
---|
| 9 | */
|
---|
| 10 | "init-declarations":
|
---|
| 11 | | Linter.RuleEntry<["always"]>
|
---|
| 12 | | Linter.RuleEntry<
|
---|
| 13 | [
|
---|
| 14 | "never",
|
---|
| 15 | Partial<{
|
---|
| 16 | ignoreForLoopInit: boolean;
|
---|
| 17 | }>,
|
---|
| 18 | ]
|
---|
| 19 | >;
|
---|
| 20 |
|
---|
| 21 | /**
|
---|
| 22 | * Rule to disallow deleting variables.
|
---|
| 23 | *
|
---|
| 24 | * @remarks
|
---|
| 25 | * Recommended by ESLint, the rule was enabled in `eslint:recommended`.
|
---|
| 26 | *
|
---|
| 27 | * @since 0.0.9
|
---|
| 28 | * @see https://eslint.org/docs/rules/no-delete-var
|
---|
| 29 | */
|
---|
| 30 | "no-delete-var": Linter.RuleEntry<[]>;
|
---|
| 31 |
|
---|
| 32 | /**
|
---|
| 33 | * Rule to disallow labels that share a name with a variable.
|
---|
| 34 | *
|
---|
| 35 | * @since 0.0.9
|
---|
| 36 | * @see https://eslint.org/docs/rules/no-label-var
|
---|
| 37 | */
|
---|
| 38 | "no-label-var": Linter.RuleEntry<[]>;
|
---|
| 39 |
|
---|
| 40 | /**
|
---|
| 41 | * Rule to disallow specified global variables.
|
---|
| 42 | *
|
---|
| 43 | * @since 2.3.0
|
---|
| 44 | * @see https://eslint.org/docs/rules/no-restricted-globals
|
---|
| 45 | */
|
---|
| 46 | "no-restricted-globals": Linter.RuleEntry<
|
---|
| 47 | [
|
---|
| 48 | ...Array<
|
---|
| 49 | | string
|
---|
| 50 | | {
|
---|
| 51 | name: string;
|
---|
| 52 | message?: string | undefined;
|
---|
| 53 | }
|
---|
| 54 | >
|
---|
| 55 | ]
|
---|
| 56 | >;
|
---|
| 57 |
|
---|
| 58 | /**
|
---|
| 59 | * Rule to disallow variable declarations from shadowing variables declared in the outer scope.
|
---|
| 60 | *
|
---|
| 61 | * @since 0.0.9
|
---|
| 62 | * @see https://eslint.org/docs/rules/no-shadow
|
---|
| 63 | */
|
---|
| 64 | "no-shadow": Linter.RuleEntry<
|
---|
| 65 | [
|
---|
| 66 | Partial<{
|
---|
| 67 | /**
|
---|
| 68 | * @default false
|
---|
| 69 | */
|
---|
| 70 | builtinGlobals: boolean;
|
---|
| 71 | /**
|
---|
| 72 | * @default 'functions'
|
---|
| 73 | */
|
---|
| 74 | hoist: "functions" | "all" | "never";
|
---|
| 75 | allow: string[];
|
---|
| 76 | }>,
|
---|
| 77 | ]
|
---|
| 78 | >;
|
---|
| 79 |
|
---|
| 80 | /**
|
---|
| 81 | * Rule to disallow identifiers from shadowing restricted names.
|
---|
| 82 | *
|
---|
| 83 | * @remarks
|
---|
| 84 | * Recommended by ESLint, the rule was enabled in `eslint:recommended`.
|
---|
| 85 | *
|
---|
| 86 | * @since 0.1.4
|
---|
| 87 | * @see https://eslint.org/docs/rules/no-shadow-restricted-names
|
---|
| 88 | */
|
---|
| 89 | "no-shadow-restricted-names": Linter.RuleEntry<[]>;
|
---|
| 90 |
|
---|
| 91 | /**
|
---|
| 92 | * Rule to disallow the use of undeclared variables unless mentioned in `global` comments.
|
---|
| 93 | *
|
---|
| 94 | * @remarks
|
---|
| 95 | * Recommended by ESLint, the rule was enabled in `eslint:recommended`.
|
---|
| 96 | *
|
---|
| 97 | * @since 0.0.9
|
---|
| 98 | * @see https://eslint.org/docs/rules/no-undef
|
---|
| 99 | */
|
---|
| 100 | "no-undef": Linter.RuleEntry<
|
---|
| 101 | [
|
---|
| 102 | Partial<{
|
---|
| 103 | /**
|
---|
| 104 | * @default false
|
---|
| 105 | */
|
---|
| 106 | typeof: boolean;
|
---|
| 107 | }>,
|
---|
| 108 | ]
|
---|
| 109 | >;
|
---|
| 110 |
|
---|
| 111 | /**
|
---|
| 112 | * Rule to disallow initializing variables to `undefined`.
|
---|
| 113 | *
|
---|
| 114 | * @since 0.0.6
|
---|
| 115 | * @see https://eslint.org/docs/rules/no-undef-init
|
---|
| 116 | */
|
---|
| 117 | "no-undef-init": Linter.RuleEntry<[]>;
|
---|
| 118 |
|
---|
| 119 | /**
|
---|
| 120 | * Rule to disallow the use of `undefined` as an identifier.
|
---|
| 121 | *
|
---|
| 122 | * @since 0.7.1
|
---|
| 123 | * @see https://eslint.org/docs/rules/no-undefined
|
---|
| 124 | */
|
---|
| 125 | "no-undefined": Linter.RuleEntry<[]>;
|
---|
| 126 |
|
---|
| 127 | /**
|
---|
| 128 | * Rule to disallow unused variables.
|
---|
| 129 | *
|
---|
| 130 | * @remarks
|
---|
| 131 | * Recommended by ESLint, the rule was enabled in `eslint:recommended`.
|
---|
| 132 | *
|
---|
| 133 | * @since 0.0.9
|
---|
| 134 | * @see https://eslint.org/docs/rules/no-unused-vars
|
---|
| 135 | */
|
---|
| 136 | "no-unused-vars": Linter.RuleEntry<
|
---|
| 137 | [
|
---|
| 138 | Partial<{
|
---|
| 139 | /**
|
---|
| 140 | * @default 'all'
|
---|
| 141 | */
|
---|
| 142 | vars: "all" | "local";
|
---|
| 143 | varsIgnorePattern: string;
|
---|
| 144 | /**
|
---|
| 145 | * @default 'after-used'
|
---|
| 146 | */
|
---|
| 147 | args: "after-used" | "all" | "none";
|
---|
| 148 | /**
|
---|
| 149 | * @default false
|
---|
| 150 | */
|
---|
| 151 | ignoreRestSiblings: boolean;
|
---|
| 152 | argsIgnorePattern: string;
|
---|
| 153 | /**
|
---|
| 154 | * @default 'none'
|
---|
| 155 | */
|
---|
| 156 | caughtErrors: "none" | "all";
|
---|
| 157 | caughtErrorsIgnorePattern: string;
|
---|
| 158 | }>,
|
---|
| 159 | ]
|
---|
| 160 | >;
|
---|
| 161 |
|
---|
| 162 | /**
|
---|
| 163 | * Rule to disallow the use of variables before they are defined.
|
---|
| 164 | *
|
---|
| 165 | * @since 0.0.9
|
---|
| 166 | * @see https://eslint.org/docs/rules/no-use-before-define
|
---|
| 167 | */
|
---|
| 168 | "no-use-before-define": Linter.RuleEntry<
|
---|
| 169 | [
|
---|
| 170 | | Partial<{
|
---|
| 171 | /**
|
---|
| 172 | * @default true
|
---|
| 173 | */
|
---|
| 174 | functions: boolean;
|
---|
| 175 | /**
|
---|
| 176 | * @default true
|
---|
| 177 | */
|
---|
| 178 | classes: boolean;
|
---|
| 179 | /**
|
---|
| 180 | * @default true
|
---|
| 181 | */
|
---|
| 182 | variables: boolean;
|
---|
| 183 | }>
|
---|
| 184 | | "nofunc",
|
---|
| 185 | ]
|
---|
| 186 | >;
|
---|
| 187 | }
|
---|