Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up dependencies in ESLint plugin so it doesn't bring in core-build-tasks #22

Merged
merged 2 commits into from
Mar 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "Clean up dependencies so they don't bring in as much bulk",
"packageName": "eslint-plugin-minecraft-linting",
"email": "[email protected]",
"dependentChangeType": "patch"
}
1,301 changes: 710 additions & 591 deletions package-lock.json

Large diffs are not rendered by default.

10 changes: 3 additions & 7 deletions tools/eslint-config-minecraft-scripting/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,8 @@
"license": "MIT",
"private": true,
"dependencies": {
"@minecraft/core-build-tasks": "*",
"@types/node": "^20.0.0",
"@typescript-eslint/eslint-plugin": "^6.10.0",
"@typescript-eslint/experimental-utils": "^5.62.0",
"@typescript-eslint/parser": "^6.10.0",
"@typescript-eslint/typescript-estree": "^6.10.0",
"@typescript-eslint/eslint-plugin": "^7.2.0",
"@typescript-eslint/parser": "^7.2.0",
"eslint": "^8.53.0",
"eslint-plugin-header": "^3.1.1",
"eslint-plugin-minecraft-linting": "*",
Expand All @@ -20,4 +16,4 @@
"publishConfig": {
"access": "public"
}
}
}
62 changes: 30 additions & 32 deletions tools/eslint-plugin-minecraft-linting/package.json
Original file line number Diff line number Diff line change
@@ -1,34 +1,32 @@
{
"name": "eslint-plugin-minecraft-linting",
"version": "1.2.0",
"main": "lib/index.js",
"types": "lib/index.d.ts",
"license": "MIT",
"scripts": {
"build": "just-scripts build",
"lint": "just-scripts lint",
"clean": "just-scripts clean",
"test": "just-scripts test",
"just": "just-scripts"
},
"files": [
"lib"
],
"dependencies": {
"@minecraft/core-build-tasks": "*",
"@types/node": "^20.0.0",
"@typescript-eslint/eslint-plugin": "^6.10.0",
"@typescript-eslint/experimental-utils": "^5.62.0",
"@typescript-eslint/parser": "^6.10.0",
"@typescript-eslint/typescript-estree": "^6.10.0",
"eslint": "^8.53.0",
"eslint-plugin-header": "^3.1.1",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-unicorn": "^42.0.0",
"just-scripts": "^2.2.1",
"tsconfig": "*"
},
"publishConfig": {
"access": "public"
}
"name": "eslint-plugin-minecraft-linting",
"version": "1.2.0",
"main": "lib/index.js",
"types": "lib/index.d.ts",
"license": "MIT",
"scripts": {
"build": "just-scripts build",
"lint": "just-scripts lint",
"clean": "just-scripts clean",
"test": "just-scripts test",
"just": "just-scripts"
},
"files": [
"lib"
],
"devDependencies": {
"@minecraft/core-build-tasks": "*",
"@types/node": "^20.0.0",
"just-scripts": "^2.2.1",
"tsconfig": "*"
},
"dependencies": {
"@typescript-eslint/utils": "^7.2.0",
"@typescript-eslint/parser": "^7.2.0",
"@typescript-eslint/eslint-plugin": "^7.2.0",
"eslint": "^8.53.0"
},
"publishConfig": {
"access": "public"
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

import { TSESLint } from '@typescript-eslint/experimental-utils';
import { TSESLint } from '@typescript-eslint/utils';
import * as path from 'path';
import { describe, it } from 'vitest';
import AvoidUnnecessaryCommand from './AvoidUnnecessaryCommand';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* API to directly match, but could be a class of APIs that have equivalent functionality.
*/

import { AST_NODE_TYPES, ESLintUtils, TSESLint } from '@typescript-eslint/experimental-utils';
import { AST_NODE_TYPES, ESLintUtils, TSESLint } from '@typescript-eslint/utils';

export type ScriptRecommendation = {
module: string;
Expand Down Expand Up @@ -305,7 +305,7 @@ const AvoidUnnecessaryCommand = ESLintUtils.RuleCreator(() => 'https://microsoft
docs: {
description:
'Recommends using a script API if there is a script API (or APIs) that provide 1:1 functionality parity with a command that is used.',
recommended: 'error',
recommended: 'recommended',
rlandav marked this conversation as resolved.
Show resolved Hide resolved
},
messages: {
replaceWithScriptMethod:
Expand All @@ -325,7 +325,6 @@ const AvoidUnnecessaryCommand = ESLintUtils.RuleCreator(() => 'https://microsoft
create(context, _options): TSESLint.RuleListener {
return {
CallExpression(node) {

// Identify if this is a call to runCommand or runCommandAsync, which occurs either
// off of the exported module object, or through any cached function reference
const invokedCallee = node.callee;
Expand Down