@blueprintjs/eslint-plugin
Advanced tools
Comparing version 3.0.1 to 4.0.0
@@ -33,3 +33,3 @@ "use strict"; | ||
description: "Enforce usage of Classes constants over namespaced string literals.", | ||
recommended: "error", | ||
recommended: "recommended", | ||
requiresTypeChecking: false, | ||
@@ -36,0 +36,0 @@ }, |
@@ -31,3 +31,3 @@ "use strict"; | ||
description: "Enforce usage of Blueprint components over JSX intrinsic elements.", | ||
recommended: "error", | ||
recommended: "recommended", | ||
requiresTypeChecking: false, | ||
@@ -34,0 +34,0 @@ }, |
@@ -29,3 +29,3 @@ "use strict"; | ||
description: "Enforce usage of JSX Icon components over IconName string literals (or vice-versa)", | ||
recommended: "error", | ||
recommended: "recommended", | ||
requiresTypeChecking: false, | ||
@@ -40,2 +40,3 @@ }, | ||
{ | ||
type: "string", | ||
enum: [exports.OPTION_COMPONENT, exports.OPTION_LITERAL], | ||
@@ -42,0 +43,0 @@ }, |
@@ -0,12 +1,13 @@ | ||
import type { TSESLint } from "@typescript-eslint/utils"; | ||
declare const _default: { | ||
"classes-constants": import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"useBlueprintClasses", [], import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleListener>; | ||
"html-components": import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"useBlueprintComponents", [], import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleListener>; | ||
"icon-components": import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"literal" | "component", ["literal" | "component"], import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleListener>; | ||
"no-deprecated-components": import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"migration" | "migrationWithPropUsage", unknown[], import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleListener>; | ||
"no-deprecated-core-components": import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"migration" | "migrationWithPropUsage", unknown[], import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleListener>; | ||
"no-deprecated-datetime-components": import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"migration" | "migrationWithPropUsage", unknown[], import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleListener>; | ||
"no-deprecated-select-components": import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"migration" | "migrationWithPropUsage", unknown[], import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleListener>; | ||
"no-deprecated-table-components": import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"migration" | "migrationWithPropUsage", unknown[], import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleListener>; | ||
"no-deprecated-type-references": import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"migration", [], import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleListener>; | ||
"classes-constants": TSESLint.RuleModule<"useBlueprintClasses", [], TSESLint.RuleListener>; | ||
"html-components": TSESLint.RuleModule<"useBlueprintComponents", [], TSESLint.RuleListener>; | ||
"icon-components": TSESLint.RuleModule<"literal" | "component", ["literal" | "component"], TSESLint.RuleListener>; | ||
"no-deprecated-components": TSESLint.RuleModule<string, unknown[], TSESLint.RuleListener>; | ||
"no-deprecated-core-components": TSESLint.RuleModule<string, unknown[], TSESLint.RuleListener>; | ||
"no-deprecated-datetime-components": TSESLint.RuleModule<string, unknown[], TSESLint.RuleListener>; | ||
"no-deprecated-select-components": TSESLint.RuleModule<string, unknown[], TSESLint.RuleListener>; | ||
"no-deprecated-table-components": TSESLint.RuleModule<string, unknown[], TSESLint.RuleListener>; | ||
"no-deprecated-type-references": TSESLint.RuleModule<"migration", [], TSESLint.RuleListener>; | ||
}; | ||
export default _default; |
@@ -33,3 +33,3 @@ "use strict"; | ||
requiresTypeChecking: false, | ||
recommended: "error", | ||
recommended: "recommended", | ||
}, | ||
@@ -42,2 +42,3 @@ messages: { | ||
{ | ||
type: "string", | ||
enum: ["migration", "migrationWithPropUsage"], | ||
@@ -44,0 +45,0 @@ }, |
@@ -0,1 +1,2 @@ | ||
import { TSESLint } from "@typescript-eslint/utils"; | ||
/** | ||
@@ -7,2 +8,2 @@ * This rule checks a hardcoded list of components that Blueprint is actively migrating to a newer version (e.g. v1 -> v2) | ||
*/ | ||
export declare const noDeprecatedComponentsRule: import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"migration" | "migrationWithPropUsage", unknown[], import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleListener>; | ||
export declare const noDeprecatedComponentsRule: TSESLint.RuleModule<string, unknown[]>; |
@@ -0,1 +1,2 @@ | ||
import { TSESLint } from "@typescript-eslint/utils"; | ||
export declare const coreComponentsMigrationMapping: {}; | ||
@@ -7,2 +8,2 @@ /** | ||
*/ | ||
export declare const noDeprecatedCoreComponentsRule: import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"migration" | "migrationWithPropUsage", unknown[], import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleListener>; | ||
export declare const noDeprecatedCoreComponentsRule: TSESLint.RuleModule<string, unknown[]>; |
@@ -0,1 +1,2 @@ | ||
import { TSESLint } from "@typescript-eslint/utils"; | ||
export declare const datetimeComponentsMigrationMapping: {}; | ||
@@ -7,2 +8,2 @@ /** | ||
*/ | ||
export declare const noDeprecatedDatetimeComponentsRule: import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"migration" | "migrationWithPropUsage", unknown[], import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleListener>; | ||
export declare const noDeprecatedDatetimeComponentsRule: TSESLint.RuleModule<string, unknown[]>; |
@@ -0,1 +1,2 @@ | ||
import { TSESLint } from "@typescript-eslint/utils"; | ||
export declare const selectComponentsMigrationMapping: {}; | ||
@@ -7,2 +8,2 @@ /** | ||
*/ | ||
export declare const noDeprecatedSelectComponentsRule: import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"migration" | "migrationWithPropUsage", unknown[], import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleListener>; | ||
export declare const noDeprecatedSelectComponentsRule: TSESLint.RuleModule<string, unknown[]>; |
@@ -0,1 +1,2 @@ | ||
import { TSESLint } from "@typescript-eslint/utils"; | ||
export declare const tableComponentsMigrationMapping: {}; | ||
@@ -7,2 +8,2 @@ /** | ||
*/ | ||
export declare const noDeprecatedTableComponentsRule: import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"migration" | "migrationWithPropUsage", unknown[], import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleListener>; | ||
export declare const noDeprecatedTableComponentsRule: TSESLint.RuleModule<string, unknown[]>; |
@@ -1,1 +0,2 @@ | ||
export declare const noDeprecatedTypeReferencesRule: import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"migration", [], import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleListener>; | ||
import { TSESLint } from "@typescript-eslint/utils"; | ||
export declare const noDeprecatedTypeReferencesRule: TSESLint.RuleModule<"migration", [], TSESLint.RuleListener>; |
@@ -184,3 +184,3 @@ "use strict"; | ||
requiresTypeChecking: false, | ||
recommended: "error", | ||
recommended: "recommended", | ||
}, | ||
@@ -193,2 +193,3 @@ fixable: "code", | ||
{ | ||
type: "string", | ||
enum: ["migration"], | ||
@@ -199,3 +200,3 @@ }, | ||
defaultOptions: [], | ||
create: context => { | ||
create: (context) => { | ||
const [deprecatedToNewType, newTypeToPackageName] = getTypeMappings(); | ||
@@ -202,0 +203,0 @@ const deprecatedImports = []; |
import { ESLintUtils } from "@typescript-eslint/utils"; | ||
/** Create a rule and automatically fill its url based on the rule name. */ | ||
export declare const createRule: <TOptions extends readonly unknown[], TMessageIds extends string, TRuleListener extends import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleListener = import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleListener>({ name, meta, ...rule }: Readonly<ESLintUtils.RuleWithMetaAndName<TOptions, TMessageIds, TRuleListener>>) => import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<TMessageIds, TOptions, TRuleListener>; | ||
export declare const createRule: ReturnType<typeof ESLintUtils.RuleCreator>; |
@@ -20,4 +20,6 @@ "use strict"; | ||
const utils_1 = require("@typescript-eslint/utils"); | ||
// N.B. We need an explicit type annotation because of the following error: | ||
// The inferred type of 'createRule' cannot be named without a reference to '../../../../../node_modules/@typescript-eslint/utils/dist/ts-eslint/Rule'. This is likely not portable. A type annotation is necessary.ts(2742) | ||
/** Create a rule and automatically fill its url based on the rule name. */ | ||
exports.createRule = utils_1.ESLintUtils.RuleCreator(name => `https://github.com/palantir/blueprint/tree/develop/packages/eslint-plugin/src/rules/${name}.ts`); | ||
//# sourceMappingURL=createRule.js.map |
@@ -1,2 +0,2 @@ | ||
import { AST_NODE_TYPES, TSESTree } from "@typescript-eslint/utils"; | ||
import { TSESTree } from "@typescript-eslint/utils"; | ||
/** | ||
@@ -6,4 +6,2 @@ * Return the top level node that is the greatest parent of the current node, if it is a Program. | ||
*/ | ||
export declare function getProgram(node: TSESTree.BaseNode & { | ||
type: AST_NODE_TYPES; | ||
}): TSESTree.Program | undefined; | ||
export declare function getProgram(node: TSESTree.BaseNode & TSESTree.NodeOrTokenData): TSESTree.Program | undefined; |
{ | ||
"name": "@blueprintjs/eslint-plugin", | ||
"version": "3.0.1", | ||
"version": "4.0.0", | ||
"description": "ESLint rules for use with @blueprintjs packages", | ||
@@ -12,14 +12,15 @@ "main": "lib/index.js", | ||
"lint-fix": "es-lint --fix", | ||
"test": "mocha" | ||
"test": "SWC_NODE_PROJECT=./tsconfig.test.json mocha --require @swc-node/register --watch-extensions ts,tsx 'test/**/*.{ts,tsx}'" | ||
}, | ||
"dependencies": { | ||
"@typescript-eslint/utils": "^5.55.0", | ||
"eslint": "^8.36.0" | ||
"@typescript-eslint/utils": "^6.5.0", | ||
"eslint": "^8.48.0" | ||
}, | ||
"devDependencies": { | ||
"@blueprintjs/node-build-scripts": "^8.0.1", | ||
"@blueprintjs/node-build-scripts": "^8.0.2", | ||
"@swc-node/register": "^1.6.7", | ||
"@swc/core": "^1.3.80", | ||
"@types/dedent": "~0.7.0", | ||
"dedent": "^0.7.0", | ||
"mocha": "^10.2.0", | ||
"ts-node": "^10.9.1", | ||
"typescript": "~4.9.5" | ||
@@ -26,0 +27,0 @@ }, |
@@ -36,3 +36,3 @@ /* | ||
description: "Enforce usage of Classes constants over namespaced string literals.", | ||
recommended: "error", | ||
recommended: "recommended", | ||
requiresTypeChecking: false, | ||
@@ -39,0 +39,0 @@ }, |
@@ -34,3 +34,3 @@ /* | ||
description: "Enforce usage of Blueprint components over JSX intrinsic elements.", | ||
recommended: "error", | ||
recommended: "recommended", | ||
requiresTypeChecking: false, | ||
@@ -37,0 +37,0 @@ }, |
@@ -33,3 +33,3 @@ /* | ||
description: "Enforce usage of JSX Icon components over IconName string literals (or vice-versa)", | ||
recommended: "error", | ||
recommended: "recommended", | ||
requiresTypeChecking: false, | ||
@@ -44,2 +44,3 @@ }, | ||
{ | ||
type: "string", | ||
enum: [OPTION_COMPONENT, OPTION_LITERAL], | ||
@@ -46,0 +47,0 @@ }, |
@@ -17,2 +17,6 @@ /* | ||
// HACKHACK: workaround to satisfy TS compiler, we need a direct type reference to be able to infer TSESLint.RuleModule | ||
// @ts-expect-error | ||
import type { TSESLint } from "@typescript-eslint/utils"; | ||
import { classesConstantsRule } from "./classes-constants"; | ||
@@ -19,0 +23,0 @@ import { htmlComponentsRule } from "./html-components"; |
@@ -41,3 +41,3 @@ /* | ||
requiresTypeChecking: false, | ||
recommended: "error", | ||
recommended: "recommended", | ||
}, | ||
@@ -52,2 +52,3 @@ messages: { | ||
{ | ||
type: "string", | ||
enum: ["migration", "migrationWithPropUsage"], | ||
@@ -54,0 +55,0 @@ }, |
@@ -5,2 +5,4 @@ /* | ||
import { TSESLint } from "@typescript-eslint/utils"; | ||
import { createNoDeprecatedComponentsRule } from "./createNoDeprecatedComponentsRule"; | ||
@@ -18,3 +20,3 @@ import { coreComponentsMigrationMapping } from "./no-deprecated-core-components"; | ||
*/ | ||
export const noDeprecatedComponentsRule = createNoDeprecatedComponentsRule( | ||
export const noDeprecatedComponentsRule: TSESLint.RuleModule<string, unknown[]> = createNoDeprecatedComponentsRule( | ||
"no-deprecated-components", | ||
@@ -21,0 +23,0 @@ ["@blueprintjs/core", "@blueprintjs/datetime", "@blueprintjs/select", "@blueprintjs/table"], |
@@ -5,2 +5,4 @@ /* | ||
import { TSESLint } from "@typescript-eslint/utils"; | ||
import { createNoDeprecatedComponentsRule } from "./createNoDeprecatedComponentsRule"; | ||
@@ -18,3 +20,3 @@ | ||
*/ | ||
export const noDeprecatedCoreComponentsRule = createNoDeprecatedComponentsRule( | ||
export const noDeprecatedCoreComponentsRule: TSESLint.RuleModule<string, unknown[]> = createNoDeprecatedComponentsRule( | ||
"no-deprecated-core-components", | ||
@@ -21,0 +23,0 @@ ["@blueprintjs/core"], |
@@ -5,2 +5,4 @@ /* | ||
import { TSESLint } from "@typescript-eslint/utils"; | ||
import { createNoDeprecatedComponentsRule } from "./createNoDeprecatedComponentsRule"; | ||
@@ -18,6 +20,7 @@ | ||
*/ | ||
export const noDeprecatedDatetimeComponentsRule = createNoDeprecatedComponentsRule( | ||
"no-deprecated-datetime-components", | ||
["@blueprintjs/datetime"], | ||
datetimeComponentsMigrationMapping, | ||
); | ||
export const noDeprecatedDatetimeComponentsRule: TSESLint.RuleModule<string, unknown[]> = | ||
createNoDeprecatedComponentsRule( | ||
"no-deprecated-datetime-components", | ||
["@blueprintjs/datetime"], | ||
datetimeComponentsMigrationMapping, | ||
); |
@@ -5,2 +5,4 @@ /* | ||
import { TSESLint } from "@typescript-eslint/utils"; | ||
import { createNoDeprecatedComponentsRule } from "./createNoDeprecatedComponentsRule"; | ||
@@ -17,6 +19,7 @@ | ||
*/ | ||
export const noDeprecatedSelectComponentsRule = createNoDeprecatedComponentsRule( | ||
"no-deprecated-select-components", | ||
["@blueprintjs/select"], | ||
selectComponentsMigrationMapping, | ||
); | ||
export const noDeprecatedSelectComponentsRule: TSESLint.RuleModule<string, unknown[]> = | ||
createNoDeprecatedComponentsRule( | ||
"no-deprecated-select-components", | ||
["@blueprintjs/select"], | ||
selectComponentsMigrationMapping, | ||
); |
@@ -5,2 +5,4 @@ /* | ||
import { TSESLint } from "@typescript-eslint/utils"; | ||
import { createNoDeprecatedComponentsRule } from "./createNoDeprecatedComponentsRule"; | ||
@@ -19,3 +21,3 @@ | ||
*/ | ||
export const noDeprecatedTableComponentsRule = createNoDeprecatedComponentsRule( | ||
export const noDeprecatedTableComponentsRule: TSESLint.RuleModule<string, unknown[]> = createNoDeprecatedComponentsRule( | ||
"no-deprecated-table-components", | ||
@@ -22,0 +24,0 @@ ["@blueprintjs/table"], |
@@ -7,3 +7,3 @@ /* | ||
import { TSESTree } from "@typescript-eslint/utils"; | ||
import { TSESLint, TSESTree } from "@typescript-eslint/utils"; | ||
@@ -197,3 +197,3 @@ import { createRule } from "./utils/createRule"; | ||
requiresTypeChecking: false, | ||
recommended: "error", | ||
recommended: "recommended", | ||
}, | ||
@@ -206,2 +206,3 @@ fixable: "code", | ||
{ | ||
type: "string", | ||
enum: ["migration"], | ||
@@ -212,3 +213,3 @@ }, | ||
defaultOptions: [], | ||
create: context => { | ||
create: (context: TSESLint.RuleContext<MessageIds, []>) => { | ||
const [deprecatedToNewType, newTypeToPackageName] = getTypeMappings(); | ||
@@ -215,0 +216,0 @@ const deprecatedImports: Array< |
@@ -19,5 +19,8 @@ /* | ||
// N.B. We need an explicit type annotation because of the following error: | ||
// The inferred type of 'createRule' cannot be named without a reference to '../../../../../node_modules/@typescript-eslint/utils/dist/ts-eslint/Rule'. This is likely not portable. A type annotation is necessary.ts(2742) | ||
/** Create a rule and automatically fill its url based on the rule name. */ | ||
export const createRule = ESLintUtils.RuleCreator( | ||
export const createRule: ReturnType<typeof ESLintUtils.RuleCreator> = ESLintUtils.RuleCreator( | ||
name => `https://github.com/palantir/blueprint/tree/develop/packages/eslint-plugin/src/rules/${name}.ts`, | ||
); |
@@ -23,4 +23,4 @@ /* | ||
*/ | ||
export function getProgram(node: TSESTree.BaseNode & { type: AST_NODE_TYPES }): TSESTree.Program | undefined { | ||
let curr = node; | ||
export function getProgram(node: TSESTree.BaseNode & TSESTree.NodeOrTokenData): TSESTree.Program | undefined { | ||
let curr: TSESTree.BaseNode | TSESTree.Program = node; | ||
while (curr.parent != null) { | ||
@@ -30,5 +30,5 @@ curr = curr.parent; | ||
if (curr.type === AST_NODE_TYPES.Program) { | ||
return curr as TSESTree.Program; | ||
return curr as unknown as TSESTree.Program; | ||
} | ||
return undefined; | ||
} |
@@ -6,2 +6,3 @@ { | ||
"module": "commonjs", | ||
"moduleResolution": "node16", | ||
"outDir": "../lib", | ||
@@ -8,0 +9,0 @@ "target": "ES2015" |
{ | ||
"extends": "ts-node/node16/tsconfig.json", | ||
"compilerOptions": { | ||
"esModuleInterop": true, | ||
"forceConsistentCasingInFileNames": true, | ||
"moduleResolution": "nodenext", | ||
"lib": ["es2021"], | ||
"module": "commonjs", | ||
"noEmit": true, | ||
@@ -11,4 +15,6 @@ "noFallthroughCasesInSwitch": true, | ||
"pretty": true, | ||
"strict": true | ||
"skipLibCheck": true, | ||
"strict": true, | ||
"target": "es2021" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
199289
3561
7
+ Added@typescript-eslint/scope-manager@6.21.0(transitive)
+ Added@typescript-eslint/types@6.21.0(transitive)
+ Added@typescript-eslint/typescript-estree@6.21.0(transitive)
+ Added@typescript-eslint/utils@6.21.0(transitive)
+ Added@typescript-eslint/visitor-keys@6.21.0(transitive)
+ Addedbrace-expansion@2.0.1(transitive)
+ Addedminimatch@9.0.3(transitive)
+ Addedts-api-utils@1.4.3(transitive)
- Removed@typescript-eslint/scope-manager@5.62.0(transitive)
- Removed@typescript-eslint/types@5.62.0(transitive)
- Removed@typescript-eslint/typescript-estree@5.62.0(transitive)
- Removed@typescript-eslint/utils@5.62.0(transitive)
- Removed@typescript-eslint/visitor-keys@5.62.0(transitive)
- Removedeslint-scope@5.1.1(transitive)
- Removedestraverse@4.3.0(transitive)
- Removedtslib@1.14.1(transitive)
- Removedtsutils@3.21.0(transitive)
Updatedeslint@^8.48.0