Skip to content

Commit

Permalink
update eslint tests (#133)
Browse files Browse the repository at this point in the history
  • Loading branch information
aeschli authored Aug 30, 2024
1 parent 1ac5606 commit 72d87cd
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 42 deletions.
28 changes: 0 additions & 28 deletions .eslintrc.js

This file was deleted.

49 changes: 49 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

import header from "@tony.ganchev/eslint-plugin-header";
import tsParser from "@typescript-eslint/parser";
import path from "node:path";
import { fileURLToPath } from "node:url";
import js from "@eslint/js";
import { FlatCompat } from "@eslint/eslintrc";

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all
});

export default [{
ignores: ["**/*.d.ts", "**/*.test.ts", "**/*.js", "sample/**/*.*"],
}, ...compat.extends("plugin:@typescript-eslint/recommended"), {
plugins: {
header,
},

languageOptions: {
parser: tsParser,
ecmaVersion: 2018,
sourceType: "module",
},

rules: {
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/no-var-requires": "error",

"header/header": [
2,
"block",
["---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------"],
],
},
}];
25 changes: 14 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"compile": "tsc -p ./ && npm run compile-fs-provider",
"watch": "tsc -w -p ./",
"prepack": "npm run compile",
"test": "eslint src --ext ts && tsc --noEmit",
"test": "eslint src && tsc --noEmit",
"preversion": "npm test",
"postversion": "git push && git push --tags",
"compile-fs-provider": "npm run --prefix=fs-provider compile-web",
Expand Down Expand Up @@ -40,6 +40,8 @@
"vscode-uri": "^3.0.8"
},
"devDependencies": {
"@eslint/eslintrc": "^3.1.0",
"@eslint/js": "^9.9.1",
"@types/gunzip-maybe": "^1.4.2",
"@types/koa": "^2.15.0",
"@types/koa__router": "^12.0.4",
Expand All @@ -52,7 +54,7 @@
"@typescript-eslint/eslint-plugin": "^8.3.0",
"@typescript-eslint/parser": "^8.3.0",
"eslint": "^9.9.1",
"eslint-plugin-header": "^3.1.1",
"@tony.ganchev/eslint-plugin-header": "^3.1.2",
"typescript": "^5.5.4"
},
"license": "MIT",
Expand Down
3 changes: 2 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,8 @@ async function cliMain(): Promise<void> {
console.error('uncaughtException', e);
});

// eslint-disable-next-line @typescript-eslint/no-var-requires
/* eslint-disable @typescript-eslint/no-var-requires */
/* eslint-disable @typescript-eslint/no-require-imports */
const manifest = require('../package.json');
console.log(`${manifest.name}: ${manifest.version}`);

Expand Down

0 comments on commit 72d87cd

Please sign in to comment.