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

chore/update-typescript-eslint-and-module-resolution #624

Open
wants to merge 14 commits into
base: development
Choose a base branch
from
Open
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ client/node_modules/**
client/out/**
server/node_modules/**
server/out/**
coc/node_modules/**
coc/out/**
client/.eslintrc.js
server/.eslintrc.js
test/e2e/projects/**
.eslintrc.js
2 changes: 1 addition & 1 deletion client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ To set **Solidity by Nomic Foundation** as your default formatter for solidity f

3. Select `Solidity` as the default formatter for solidity files

![Format Document With](https://raw.githubusercontent.com/NomicFoundation/hardhat-vscode/main/docs/images/select_solidity_plus_hardhat.png "Configure default formatter")
![Format Document With](https://raw.githubusercontent.com/NomicFoundation/hardhat-vscode/main/docs/images/select_solidity_plus_hardhat.png "Confiure default formatter")

### Formatting Configuration

Expand Down
1 change: 0 additions & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@
"@sentry/types": "6.19.1",
"@types/prettier": "2.6.0",
"@types/vscode": "^1.86",
"eslint": "^7.23.0",
"rimraf": "3.0.2",
"prettier": "2.5.1"
},
Expand Down
5 changes: 1 addition & 4 deletions client/scripts/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@ const path = require("path");
const { exec } = require("child_process");
const esbuild = require("esbuild");

const ANTLR_MODULE_PATH =
"../server/node_modules/@solidity-parser/parser/dist/antlr";
const SERVER_MODULE_PATH =
"../node_modules/@nomicfoundation/solidity-language-server";
const ANTLR_MODULE_PATH = "../node_modules/@solidity-parser/parser/dist/antlr";

const SOLIDITY_TOKENS = "Solidity.tokens";
const SOLIDITY_LEXER_TOKENS = "SolidityLexer.tokens";
Expand Down
1 change: 1 addition & 0 deletions client/src/commands/CleanCommand.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// eslint-disable-next-line @typescript-eslint/naming-convention
import HardhatTaskCommand from "./HardhatTaskCommand";

export default class CleanCommand extends HardhatTaskCommand {
Expand Down
1 change: 1 addition & 0 deletions client/src/commands/CompileCommand.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// eslint-disable-next-line @typescript-eslint/naming-convention
import HardhatTaskCommand from "./HardhatTaskCommand";

export default class CompileCommand extends HardhatTaskCommand {
Expand Down
1 change: 1 addition & 0 deletions client/src/commands/FlattenCurrentFileCommand.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import vscode from "vscode";
import { getCurrentOpenFile } from "../utils/workspace";
import { openNewDocument } from "../utils/window";
// eslint-disable-next-line @typescript-eslint/naming-convention
import HardhatTaskCommand from "./HardhatTaskCommand";

export default class FlattenCurrentFileCommand extends HardhatTaskCommand {
Expand Down
1 change: 1 addition & 0 deletions client/src/commands/HardhatTaskCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
withProgressNotification,
} from "../utils/window";
import { ensureCurrentHardhatDir } from "../utils/workspace";
// eslint-disable-next-line @typescript-eslint/naming-convention
import Command from "./Command";

export default abstract class HardhatTaskCommand extends Command {
Expand Down
1 change: 1 addition & 0 deletions client/src/setup/setupCommands.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/naming-convention */
import * as vscode from "vscode";
import { ExtensionState } from "../types";

Expand Down
1 change: 1 addition & 0 deletions client/src/telemetry/SentryClientTelemetry.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// eslint-disable-next-line @typescript-eslint/naming-convention
import * as Sentry from "@sentry/node";
import { ExtensionState } from "../types";
import { isTelemetryEnabled } from "../utils/telemetry";
Expand Down
8 changes: 5 additions & 3 deletions client/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es2020",
"lib": ["es2020"],
"module": "node16",
"moduleResolution": "node16",
"target": "es2022",
"lib": ["es2023"],
"outDir": "out",
"rootDir": "src",
"sourceMap": true,
"composite": true,
"esModuleInterop": true,
"skipLibCheck": true,
"strict": true
},
"include": ["src"],
Expand Down
18 changes: 18 additions & 0 deletions coc/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/** @type {import('eslint').Linter.Config} */
module.exports = {
root: true,
extends: [`../.eslintrc.js`],
parserOptions: {
project: `${__dirname}/tsconfig.json`,
sourceType: "module",
},
overrides: [
{
files: ["**/*.ts"],
rules: {
"@typescript-eslint/no-unused-vars": "warn",
"@typescript-eslint/no-empty-function": "warn",
},
},
],
};
4 changes: 1 addition & 3 deletions coc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@
"@nomicfoundation/solidity-language-server": "0.8.8"
},
"devDependencies": {
"coc.nvim": "^0.0.80",
"esbuild": "^0.16.0",
"eslint": "^7.23.0"
"coc.nvim": "^0.0.80"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't our build/lint scripts fail if we remove those dev dependencies?

},
"engines": {
"coc": "^0.0.80"
Expand Down
8 changes: 4 additions & 4 deletions coc/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"compilerOptions": {
"target": "es2020",
"lib": ["es2020"],
"module": "commonjs",
"moduleResolution": "node",
"target": "es2022",
"lib": ["es2023"],
"module": "node16",
"moduleResolution": "node16",
"outDir": "out",
"allowJs": true,
"sourceMap": true,
Expand Down
Loading