Skip to content
This repository has been archived by the owner on Oct 25, 2022. It is now read-only.

Commit

Permalink
feat: Modernize TS/ESLint config
Browse files Browse the repository at this point in the history
  • Loading branch information
oliversalzburg committed Apr 29, 2022
1 parent a8b5527 commit 99e48ed
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 23 deletions.
6 changes: 5 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ module.exports = {
root: true,
env: {
node: true,
es6: true,
es2022: true,
},
parserOptions: {
ecmaVersion: "latest",
},
extends: ["eslint:recommended"],
plugins: ["@typescript-eslint"],
Expand All @@ -15,6 +18,7 @@ module.exports = {
],
parserOptions: {
project: ["./tsconfig.json"],
sourceType: "module",
},
rules: {
"@typescript-eslint/no-explicit-any": [
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"@types/node": "16.11.32",
"@types/prettier": "2.6.0",
"@types/prettier-package-json": "2.1.1",
"@types/web": "0.0.62",
"@typescript-eslint/eslint-plugin": "5.21.0",
"@typescript-eslint/parser": "5.21.0",
"eslint": "8.14.0",
Expand Down
4 changes: 1 addition & 3 deletions packages/userscript/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
"compilerOptions": {
"rootDir": "source",
"outDir": "output",
"incremental": true,
"inlineSourceMap": true,
"tsBuildInfoFile": "output/.tsbuildinfo"
},
"include": ["../../@types", "source"]
"include": ["../../@types", "./source"]
}
8 changes: 0 additions & 8 deletions packages/userscript/webpack.config.inject.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
/* eslint-disable @typescript-eslint/no-var-requires */

const path = require("path");
const PnpWebpackPlugin = require("pnp-webpack-plugin");
const webpack = require("webpack");

const KG_SAVEGAME = process.env.KG_SAVEGAME ?? "./fixtures/lategame";
Expand All @@ -16,7 +13,6 @@ module.exports = {
{
test: /\.ts$/,
loader: require.resolve("ts-loader"),
options: PnpWebpackPlugin.tsLoaderOptions(),
},
],
},
Expand All @@ -30,9 +26,5 @@ module.exports = {
],
resolve: {
extensions: [".ts", ".js"],
plugins: [PnpWebpackPlugin],
},
resolveLoader: {
plugins: [PnpWebpackPlugin.moduleLoader(module)],
},
};
2 changes: 0 additions & 2 deletions packages/userscript/webpack.config.userscript.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable @typescript-eslint/no-var-requires */

const isDevBuild = process.env.NODE_ENV === "development";
const path = require("path");
const TerserPlugin = require("terser-webpack-plugin");
Expand Down
19 changes: 10 additions & 9 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
{
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"baseUrl": ".",
"checkJs": true,
"esModuleInterop": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"forceConsistentCasingInFileNames": true,
"importHelpers": true,
"lib": ["DOM", "ESNext"],
"module": "ESNext",
"moduleResolution": "Node",
"outDir": "output",
"resolveJsonModule": true,
"lib": ["DOM", "ES2020"],
"module": "CommonJS",
"sourceMap": true,
"strict": true,
"target": "ES2017",
"target": "ESNext",
"incremental": true,
"declaration": false,
"skipLibCheck": true,
"types": [],
},
"exclude": [".yarn", "packages/*/output"]
"types": ["@types/web"]
}
}
8 changes: 8 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,13 @@ __metadata:
languageName: node
linkType: hard

"@types/web@npm:0.0.62":
version: 0.0.62
resolution: "@types/web@npm:0.0.62"
checksum: f808f394dd30dcf52d08a4d6eed00cb11288733e7485373b043d9a9819de182ad0f2c598e3346c5074f89359eec89345ef65a8b86724a34450880c6fa11020d3
languageName: node
linkType: hard

"@typescript-eslint/eslint-plugin@npm:5.21.0":
version: 5.21.0
resolution: "@typescript-eslint/eslint-plugin@npm:5.21.0"
Expand Down Expand Up @@ -1979,6 +1986,7 @@ __metadata:
"@types/node": 16.11.32
"@types/prettier": 2.6.0
"@types/prettier-package-json": 2.1.1
"@types/web": 0.0.62
"@typescript-eslint/eslint-plugin": 5.21.0
"@typescript-eslint/parser": 5.21.0
eslint: 8.14.0
Expand Down

0 comments on commit 99e48ed

Please sign in to comment.