Skip to content

Commit

Permalink
Update yarn.lock, eslint and rollup configs
Browse files Browse the repository at this point in the history
  • Loading branch information
szymmis committed Aug 29, 2024
1 parent c80f51c commit 1da844c
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 2 deletions.
42 changes: 42 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import typescriptEslint from "@typescript-eslint/eslint-plugin";
import simpleImportSort from "eslint-plugin-simple-import-sort";
import globals from "globals";
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: ["**/*.config.js", "**/*.config.ts", "**/dist"],
}, ...compat.extends("eslint:recommended", "plugin:@typescript-eslint/recommended"), {
plugins: {
"@typescript-eslint": typescriptEslint,
"simple-import-sort": simpleImportSort,
},

languageOptions: {
globals: {
...globals.node,
...globals.browser,
},

parser: tsParser,
ecmaVersion: "latest",
sourceType: "module",
},

rules: {
"simple-import-sort/imports": "error",
"simple-import-sort/exports": "error",
"@typescript-eslint/no-var-requires": "off",
},
}];
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
"picocolors": "^1.0.0"
},
"devDependencies": {
"@eslint/eslintrc": "^3.1.0",
"@eslint/js": "^9.9.1",
"@rollup/plugin-terser": "^0.4.4",
"@rollup/plugin-typescript": "^11.1.5",
"@types/express": "^4.17.21",
Expand All @@ -41,6 +43,7 @@
"eslint": "^9.9.0",
"eslint-plugin-simple-import-sort": "^12.1.1",
"express": "^4.18.2",
"globals": "^15.9.0",
"husky": "^9.1.4",
"lint-staged": "^15.1.0",
"nodemon": "^3.0.1",
Expand Down
10 changes: 9 additions & 1 deletion rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ export default {
dir: "dist",
format: "cjs",
},
external: ["express", "vite", "node-fetch", "fs", "path", "picocolors"],
external: [
"express",
"vite",
"node-fetch",
"fs",
"path",
"picocolors",
"express-static-gzip",
],
plugins: [typescript({ module: "ESNext", include: "src/main.ts" })],
};
19 changes: 18 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,11 @@
resolved "https://registry.yarnpkg.com/@eslint/js/-/js-9.9.0.tgz#d8437adda50b3ed4401964517b64b4f59b0e2638"
integrity sha512-hhetes6ZHP3BlXLxmd8K2SNgkhNSi+UcecbnwWKwpP7kyi/uC75DJ1lOOBO3xrC4jyojtGE3YxKZPHfk4yrgug==

"@eslint/js@^9.9.1":
version "9.9.1"
resolved "https://registry.yarnpkg.com/@eslint/js/-/js-9.9.1.tgz#4a97e85e982099d6c7ee8410aacb55adaa576f06"
integrity sha512-xIDQRsfg5hNBqHz04H1R3scSVwmI+KUbqjsQKHKQ1DAUSaUjYPReZZmS/5PNiKu1fUvzDd6H7DEDKACSEhu+TQ==

"@eslint/object-schema@^2.1.4":
version "2.1.4"
resolved "https://registry.yarnpkg.com/@eslint/object-schema/-/object-schema-2.1.4.tgz#9e69f8bb4031e11df79e03db09f9dbbae1740843"
Expand Down Expand Up @@ -1979,6 +1984,13 @@ execa@^8.0.1, execa@~8.0.1:
signal-exit "^4.1.0"
strip-final-newline "^3.0.0"

express-static-gzip@^2.1.7:
version "2.1.7"
resolved "https://registry.yarnpkg.com/express-static-gzip/-/express-static-gzip-2.1.7.tgz#5904824a07950ba741ec3a23a21839dd04c63506"
integrity sha512-QOCZUC+lhPPCjIJKpQGu1Oa61Axg9Mq09Qvit8Of7kzpMuwDeMSqjjQteQS3OVw/GkENBoSBheuQDWPlngImvw==
dependencies:
serve-static "^1.14.1"

express@^4.18.2:
version "4.19.2"
resolved "https://registry.yarnpkg.com/express/-/express-4.19.2.tgz#e25437827a3aa7f2a827bc8171bbbb664a356465"
Expand Down Expand Up @@ -2276,6 +2288,11 @@ globals@^14.0.0:
resolved "https://registry.yarnpkg.com/globals/-/globals-14.0.0.tgz#898d7413c29babcf6bafe56fcadded858ada724e"
integrity sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==

globals@^15.9.0:
version "15.9.0"
resolved "https://registry.yarnpkg.com/globals/-/globals-15.9.0.tgz#e9de01771091ffbc37db5714dab484f9f69ff399"
integrity sha512-SmSKyLLKFbSr6rptvP8izbyxJL4ILwqO9Jg23UA0sDlGlu58V59D1//I3vlc0KJphVdUR7vMjHIplYnzBxorQA==

globby@^11.1.0:
version "11.1.0"
resolved "https://registry.yarnpkg.com/globby/-/globby-11.1.0.tgz#bd4be98bb042f83d796f7e3811991fbe82a0d34b"
Expand Down Expand Up @@ -3334,7 +3351,7 @@ serialize-javascript@^6.0.1:
dependencies:
randombytes "^2.1.0"

serve-static@1.15.0:
serve-static@1.15.0, serve-static@^1.14.1:
version "1.15.0"
resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.15.0.tgz#faaef08cffe0a1a62f60cad0c4e513cff0ac9540"
integrity sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==
Expand Down

0 comments on commit 1da844c

Please sign in to comment.