Skip to content

Commit 90bb996

Browse files
committed
Update configs
1 parent 67b93bf commit 90bb996

File tree

10 files changed

+68
-57
lines changed

10 files changed

+68
-57
lines changed

.eslintrc.js

Lines changed: 3 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,16 @@
11
/** @type import("eslint").Linter.Config */
22
module.exports = {
3-
env: { node: true },
4-
extends: [
5-
"eslint:recommended",
6-
"plugin:import/recommended",
7-
"plugin:promise/recommended",
8-
"plugin:@typescript-eslint/eslint-recommended",
9-
"plugin:@typescript-eslint/recommended",
10-
"plugin:@typescript-eslint/recommended-requiring-type-checking",
11-
"plugin:import/typescript",
12-
"prettier",
13-
],
14-
noInlineConfig: true,
15-
parser: "@typescript-eslint/parser",
3+
root: true,
4+
extends: ["@paleite"],
165
parserOptions: {
176
project: [
187
`${__dirname}/tsconfig.json`,
198
`${__dirname}/tsconfig.eslint.json`,
209
],
2110
},
22-
reportUnusedDisableDirectives: true,
23-
root: true,
24-
rules: {
25-
curly: ["error", "all"],
26-
eqeqeq: "error",
27-
28-
/**
29-
* TypeScript provides equivalent checks, so we turn them off
30-
* @see https://github.com/typescript-eslint/typescript-eslint/blob/master/docs/getting-started/linting/FAQ.md#eslint-plugin-import
31-
*/
32-
"import/default": "off",
33-
"import/named": "off",
34-
"import/namespace": "off",
35-
"import/no-named-as-default-member": "off",
36-
},
3711
overrides: [
3812
{
39-
files: ["lint-staged.config.js"],
13+
files: ["lint-staged.config.js", "jest.config.js"],
4014

4115
rules: {
4216
"@typescript-eslint/no-var-requires": "off",

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
16

cspell.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"version": "0.2",
3+
"ignorePaths": [],
4+
"dictionaryDefinitions": [],
5+
"dictionaries": [],
6+
"words": ["Eriksson", "paleite", "pinst"],
7+
"ignoreWords": [],
8+
"import": []
9+
}

jest.config.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
const { base } = require("@paleite/jest-config");
2+
13
/** @typedef {import('ts-jest')} */
24
/** @type {import('@jest/types').Config.InitialOptions} */
35
module.exports = {
4-
collectCoverageFrom: ["src/**/*.ts"],
6+
...base,
57
coverageThreshold: {
68
global: {
79
branches: 75,
@@ -10,7 +12,4 @@ module.exports = {
1012
statements: 80,
1113
},
1214
},
13-
preset: "ts-jest",
14-
testEnvironment: "node",
15-
modulePathIgnorePatterns: ["<rootDir>/dist/"],
1615
};

package.json

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,22 @@
3030
"build": "tsc --build tsconfig.build.json",
3131
"clean": "tsc --build tsconfig.build.json --clean",
3232
"format": "prettier --write .",
33-
"lint": "eslint --cache --ext .js,.ts --fix --format codeframe .",
34-
"release": "np",
35-
"test": "jest --coverage",
36-
"typecheck": "tsc --project tsconfig.json",
33+
"postinstall": "husky install",
34+
"lint": "eslint --cache --ext .js,.ts --fix .",
35+
"prepublishOnly": "pinst --disable",
3736
"prepublish": "yarn run clean && yarn run build",
3837
"postpublish": "pinst --enable",
39-
"postinstall": "husky install",
40-
"prepublishOnly": "pinst --disable"
38+
"release": "np",
39+
"test": "jest --coverage",
40+
"typecheck": "tsc --project tsconfig.json"
4141
},
4242
"devDependencies": {
43-
"@tsconfig/node10": "^1.0.8",
43+
"@paleite/eslint-config": "canary",
44+
"@paleite/eslint-config-base": "canary",
45+
"@paleite/eslint-config-typescript": "canary",
46+
"@paleite/jest-config": "canary",
47+
"@paleite/prettier-config": "canary",
48+
"@paleite/tsconfig-node16": "canary",
4449
"@types/eslint": "^8.2.1",
4550
"@types/jest": "^27.0.3",
4651
"@types/node": "^16.11.13",
@@ -53,6 +58,7 @@
5358
"eslint-plugin-promise": "^5.2.0",
5459
"husky": "^7.0.4",
5560
"jest": "^27.4.5",
61+
"jest-mock": "^27.4.2",
5662
"lint-staged": "^12.1.2",
5763
"np": "^7.6.0",
5864
"pinst": "^2.1.6",
@@ -64,6 +70,6 @@
6470
"eslint": ">=6.7.0"
6571
},
6672
"engines": {
67-
"node": ">=10.23.0"
73+
"node": ">=12.0.0"
6874
}
6975
}

src/git.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as child_process from "child_process";
22
import path from "path";
3-
import { mocked } from "ts-jest/utils";
3+
import { mocked } from "jest-mock";
44
import {
55
getDiffFileList,
66
getDiffForFile,

src/index.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as child_process from "child_process";
2-
import { mocked } from "ts-jest/utils";
2+
import { mocked } from "jest-mock";
33

44
jest.mock("child_process");
55
const mockedChildProcess = mocked(child_process, true);

src/processors.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as child_process from "child_process";
22
import type { Linter } from "eslint";
3-
import { mocked } from "ts-jest/utils";
3+
import { mocked } from "jest-mock";
44
import * as git from "./git";
55
import { diff, diffConfig, staged, stagedConfig } from "./processors";
66
import {

tsconfig.base.json

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
{
2-
"extends": "@tsconfig/node10/tsconfig.json",
2+
"extends": "@paleite/tsconfig-node16",
33
"compilerOptions": {
4-
"allowUnreachableCode": false,
5-
"composite": true,
6-
"moduleResolution": "node",
7-
"noImplicitReturns": true,
8-
"noUnusedLocals": true,
9-
"noUnusedParameters": true,
10-
"types": ["jest", "node"]
4+
// #region Support running on Node 12 until EOL, April 30th, 2022
5+
"lib": ["es2019", "es2020.promise", "es2020.bigint", "es2020.string"],
6+
"target": "es2019"
7+
// #endregion
118
}
129
}

yarn.lock

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,36 @@
521521
"@nodelib/fs.scandir" "2.1.5"
522522
fastq "^1.6.0"
523523

524+
"@paleite/eslint-config-base@canary":
525+
version "0.0.1-canary.6"
526+
resolved "https://registry.yarnpkg.com/@paleite/eslint-config-base/-/eslint-config-base-0.0.1-canary.6.tgz#461fdab19f61432d7327aa4a947c494044b610f5"
527+
integrity sha512-hc/3JffvanmvBLSUrqWlUsQ/5j0X1kgQ4hurN/d7wd2s/hi2ODTuppzqjBqk6XDr+be7iAtk02/AkKj4RN+ybQ==
528+
529+
"@paleite/eslint-config-typescript@canary":
530+
version "0.0.1-canary.6"
531+
resolved "https://registry.yarnpkg.com/@paleite/eslint-config-typescript/-/eslint-config-typescript-0.0.1-canary.6.tgz#510a231bd8b1b72b3e7a60455d3c217bdd5ae4e3"
532+
integrity sha512-xcYshVDC5JT1RPUzS+BJ8Ppg6B2r0F5DPeE6zsl+ellY/rr8k9Dl4cgElZ/0+EtHSgOjXHmDCLFUgXP+vB5Psg==
533+
534+
"@paleite/eslint-config@canary":
535+
version "0.0.1-canary.6"
536+
resolved "https://registry.yarnpkg.com/@paleite/eslint-config/-/eslint-config-0.0.1-canary.6.tgz#2d0ee6d621d15aeaeda9de3e0d16d14369fcc65b"
537+
integrity sha512-ksi3P9yQqsaS1SlXxyRQEgg3f/tqVY9Uka70giYDq3Oqf/N5Gjo9ULapn2UWFTHYnYlCOwuL8gCSTLUBhP0/gA==
538+
539+
"@paleite/jest-config@canary":
540+
version "0.0.1-canary.6"
541+
resolved "https://registry.yarnpkg.com/@paleite/jest-config/-/jest-config-0.0.1-canary.6.tgz#7612e3c7f661bc2d44ca64886b752e4af5de9198"
542+
integrity sha512-8oI/W5fUtdJUjF+q/MIZJ3tpWko331SK5yiW+BbxU4K3+vGpddxjN6XLsRkvxeC5OOCrItvkOG6Shx0XK1hUKQ==
543+
544+
"@paleite/prettier-config@canary":
545+
version "0.0.1-canary.6"
546+
resolved "https://registry.yarnpkg.com/@paleite/prettier-config/-/prettier-config-0.0.1-canary.6.tgz#85d71afe48bb0316efbc9e086f0ade438eb7c9d2"
547+
integrity sha512-XiF8DVTcXW+i1VcugCZqfkzBZrzRIyhTahoIBX4KjaS+IR1CjWrvzS42RkYYHOEF2Px0MShOYh3UFwESv1sX0Q==
548+
549+
"@paleite/tsconfig-node16@canary":
550+
version "0.0.1-canary.6"
551+
resolved "https://registry.yarnpkg.com/@paleite/tsconfig-node16/-/tsconfig-node16-0.0.1-canary.6.tgz#fa8cb54d30c377418c0244eaad2e5d022198a1df"
552+
integrity sha512-E8z1vHI+9Ev7hbBtr8auqwESllzo2zyGJuogPN60zO9x6GTvb1eZSJOxjptE9SGadwom5WyUrmotlXBo64mzBA==
553+
524554
"@samverschueren/stream-to-observable@^0.3.0", "@samverschueren/stream-to-observable@^0.3.1":
525555
version "0.3.1"
526556
resolved "https://registry.yarnpkg.com/@samverschueren/stream-to-observable/-/stream-to-observable-0.3.1.tgz#a21117b19ee9be70c379ec1877537ef2e1c63301"
@@ -576,11 +606,6 @@
576606
resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-1.1.2.tgz#ccb91445360179a04e7fe6aff78c00ffc1eeaf82"
577607
integrity sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==
578608

579-
"@tsconfig/node10@^1.0.8":
580-
version "1.0.8"
581-
resolved "https://registry.yarnpkg.com/@tsconfig/node10/-/node10-1.0.8.tgz#c1e4e80d6f964fbecb3359c43bd48b40f7cadad9"
582-
integrity sha512-6XFfSQmMgq0CFLY1MslA/CPUfhIL919M1rMsa5lP2P097N2Wd1sSX0tx1u4olM16fLNhtHZpRhedZJphNJqmZg==
583-
584609
"@types/babel__core@^7.0.0", "@types/babel__core@^7.1.14":
585610
version "7.1.17"
586611
resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.17.tgz#f50ac9d20d64153b510578d84f9643f9a3afbe64"

0 commit comments

Comments
 (0)