Skip to content

Commit

Permalink
separate configs for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
emma-sg committed Aug 20, 2024
1 parent b686b78 commit 8a4009a
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 56 deletions.
47 changes: 8 additions & 39 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,32 +1,3 @@
// module.exports = {
// env: {
// browser: true,
// es6: true,
// },
// extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
// parser: "@typescript-eslint/parser",
// parserOptions: {
// sourceType: "module",
// project: "./tsconfig.json",
// },
// plugins: ["@typescript-eslint", "deprecation"],
// rules: {
// indent: [
// "error",
// 2,
// {
// SwitchCase: 1,
// // Note: offsetTernaryExpressions is broken, see eslint/issues/14058
// offsetTernaryExpressions: true,
// },
// ],
// "linebreak-style": ["error", "unix"],
// quotes: ["error", "double"],
// semi: ["error", "always"],
// "deprecation/deprecation": "warn",
// },
// };

/* eslint-env node */
/** @type {import('eslint').Linter.Config} */
module.exports = {
Expand Down Expand Up @@ -132,22 +103,20 @@ module.exports = {
"@typescript-eslint/no-empty-interface": "warn",
},
reportUnusedDisableDirectives: true,
ignorePatterns: [
"__generated__",
"__mocks__",
"mkdocs/_genhtml",
"dist",
"ruffle",
"**/ui.js",
"**/sw.js",
],
ignorePatterns: ["__generated__", "__mocks__", "dist"],
overrides: [
{
extends: ["plugin:@typescript-eslint/disable-type-checked"],
files: ["webpack.*.js"],
files: [".*.cjs"],
rules: {
"@typescript-eslint/no-var-requires": "off",
},
},
{
parserOptions: {
project: "./test/tsconfig.json",
},
files: ["test/**/*.ts"],
},
],
};
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
],
"scripts": {
"build": "tsup && tsup --define.browser='true'",
"check": "tsc --noEmit",
"format": "prettier --write src test",
"lint": "eslint 'src/**/*.ts' 'test/**/*.ts'",
"test": "NODE_OPTIONS=--experimental-vm-modules yarn jest --collectCoverage",
Expand All @@ -60,7 +61,6 @@
"yargs": "^17.6.2"
},
"devDependencies": {
"@types/eslint": "^7.29.0",
"@types/jest": "^29.2.3",
"@types/node": "^18.11.9",
"@types/yargs": "^17.0.17",
Expand Down
3 changes: 2 additions & 1 deletion test/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
"extends": "../tsconfig.json",
"compilerOptions": {
"module": "ESNext"
}
},
"include": ["**/*"]
}
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@
"resolveJsonModule": true,
"skipLibCheck": false,
"strict": true
}
},
"include": ["src/**/*"]
}
15 changes: 1 addition & 14 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -799,19 +799,6 @@
resolved "https://registry.yarnpkg.com/@types/color-name/-/color-name-1.1.1.tgz#1c1261bbeaa10a8055bbc5d8ab84b7b2afc846a0"
integrity sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==

"@types/eslint@^7.29.0":
version "7.29.0"
resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-7.29.0.tgz#e56ddc8e542815272720bb0b4ccc2aff9c3e1c78"
integrity sha512-VNcvioYDH8/FxaeTKkM4/TiTwt6pBV9E3OfGmvaw8tPl0rrHCJ4Ll15HRT+pMiFAf/MLQvAzC+6RzUMEL9Ceng==
dependencies:
"@types/estree" "*"
"@types/json-schema" "*"

"@types/estree@*":
version "0.0.39"
resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.39.tgz#e177e699ee1b8c22d23174caaa7422644389509f"
integrity sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==

"@types/graceful-fs@^4.1.3":
version "4.1.6"
resolved "https://registry.yarnpkg.com/@types/graceful-fs/-/graceful-fs-4.1.6.tgz#e14b2576a1c25026b7f02ede1de3b84c3a1efeae"
Expand Down Expand Up @@ -846,7 +833,7 @@
expect "^29.0.0"
pretty-format "^29.0.0"

"@types/json-schema@*", "@types/json-schema@^7.0.9":
"@types/json-schema@^7.0.9":
version "7.0.11"
resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.11.tgz#d421b6c527a3037f7c84433fd2c4229e016863d3"
integrity sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==
Expand Down

0 comments on commit 8a4009a

Please sign in to comment.