From d63df349ad1baae56c318f194a7a14490c1c394f Mon Sep 17 00:00:00 2001 From: noahnu Date: Sat, 20 Apr 2024 12:24:41 -0400 Subject: [PATCH] chore: use @noahnu/eslint-config --- .eslintrc.js | 33 +-- .yarnrc.yml | 2 + jest.config.js | 1 - package.json | 6 +- packages/internal-test-utils/src/index.ts | 2 +- packages/unused-files/src/api/index.ts | 4 +- yarn.lock | 250 +++++----------------- 7 files changed, 57 insertions(+), 241 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 1e8448b..f08d7d0 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,39 +1,8 @@ module.exports = { root: true, - extends: ['@tophat/eslint-config/base', '@tophat/eslint-config/jest'], + extends: ['@noahnu/eslint-config'], parserOptions: { project: './tsconfig.lint.json', }, - rules: { - 'prettier/prettier': [ - 'error', - { - printWidth: 100, - tabWidth: 4, - semi: false, - trailingComma: 'all' /* Reduces git diff. */, - singleQuote: true, - arrowParens: 'always', // Reduces character diff when adding Typescript types. - }, - ], - '@typescript-eslint/no-non-null-assertion': 'off', - 'no-empty': ['error', { allowEmptyCatch: true }], - 'import/order': [ - 'error', - { - alphabetize: { order: 'asc' }, - 'newlines-between': 'always', - groups: [ - 'unknown', - 'builtin', - 'external', - 'internal', - 'parent', - 'sibling', - 'index', - ], - }, - ], - }, ignorePatterns: ['**/.*', 'packages/**/*.js', '**/lib'], } diff --git a/.yarnrc.yml b/.yarnrc.yml index 27c1711..140273f 100644 --- a/.yarnrc.yml +++ b/.yarnrc.yml @@ -3,3 +3,5 @@ nodeLinker: pnp npmRegistries: //registry.npmjs.org/: npmAuthToken: "${NPM_PUBLISH_TOKEN:-invalid}" + +enableTransparentWorkspaces: false diff --git a/jest.config.js b/jest.config.js index 28b71c1..5480490 100644 --- a/jest.config.js +++ b/jest.config.js @@ -32,7 +32,6 @@ const config = { }, modulePathIgnorePatterns: ['/.*/lib'], testTimeout: 30000, - resolver: require.resolve('@tophat/jest-resolver'), } module.exports = config diff --git a/package.json b/package.json index af59be2..c020382 100644 --- a/package.json +++ b/package.json @@ -22,12 +22,10 @@ "devDependencies": { "@jest/types": "^29.6.3", "@monoweave/plugin-github": "^2.1.0", + "@noahnu/eslint-config": "^1.0.0", "@tophat/commitizen-adapter": "^1.0.2", "@tophat/commitlint-config": "^1.0.2", "@tophat/conventional-changelog-config": "^1.0.1", - "@tophat/eslint-config": "^9.0.0", - "@tophat/eslint-import-resolver-require": "^1.0.0", - "@tophat/jest-resolver": "^0.1.0", "@types/jest": "^29.5.12", "@types/node": "^20.12.2", "@typescript-eslint/eslint-plugin": "^7.4.0", @@ -44,8 +42,6 @@ "eslint-plugin-jest": "^27.9.0", "eslint-plugin-jsx-a11y": "^6.8.0", "eslint-plugin-prettier": "^5.1.3", - "eslint-plugin-react": "^7.34.1", - "eslint-plugin-react-hooks": "^4.6.0", "husky": "^9.0.11", "jest": "^29.7.0", "jest-junit": "^16.0.0", diff --git a/packages/internal-test-utils/src/index.ts b/packages/internal-test-utils/src/index.ts index edb5256..5bceb12 100644 --- a/packages/internal-test-utils/src/index.ts +++ b/packages/internal-test-utils/src/index.ts @@ -6,7 +6,7 @@ import path from 'node:path' // @ts-expect-error Symbol.asyncDispose ??= Symbol.for('asyncDispose') -export type TempDirContext = { +export interface TempDirContext { dir: string writeFile: (name: string, contents: string) => Promise } diff --git a/packages/unused-files/src/api/index.ts b/packages/unused-files/src/api/index.ts index e5cce85..bfc75f6 100644 --- a/packages/unused-files/src/api/index.ts +++ b/packages/unused-files/src/api/index.ts @@ -7,7 +7,7 @@ import { walkDependencyTree } from './walkDependencyTree' const debug = createDebug('unused-files') -export type FindUnusedFilesOptions = { +export interface FindUnusedFilesOptions { /** * Entry files into the codebase. These files are known to be used and any files that * are dependencies of these entry files are also considered used files. @@ -39,7 +39,7 @@ export type FindUnusedFilesOptions = { cwd?: string } -export type UnusedFilesResult = { +export interface UnusedFilesResult { unusedFiles: string[] } diff --git a/yarn.lock b/yarn.lock index 3a27c2c..1c060be 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1350,6 +1350,32 @@ __metadata: languageName: node linkType: hard +"@noahnu/eslint-config@npm:^1.0.0": + version: 1.0.0 + resolution: "@noahnu/eslint-config@npm:1.0.0" + dependencies: + "@noahnu/eslint-import-resolver-require": "npm:^0.0.5" + debug: "npm:^4.3.4" + eslint-import-resolver-typescript: "npm:^3.6.1" + peerDependencies: + "@noahnu/eslint-import-resolver-require": ^0.0.5 + "@typescript-eslint/eslint-plugin": ">=7.4.0" + "@typescript-eslint/parser": ">=7.4.0" + eslint: ">=8.57.0" + eslint-config-prettier: ">=9.1.0" + eslint-import-resolver-node: ">=0.3.9" + eslint-import-resolver-typescript: ">=3.6.1" + eslint-plugin-import: ">=2.29.1" + eslint-plugin-jest: ">=27.9.0" + eslint-plugin-prettier: ">=5.1.3" + prettier: ">=3.2.5" + typescript: ">=5.4.3" + bin: + eslint-config: ./lib/bin.js + checksum: 10c0/448034f84580ecc89c28367db8ed0e91e11db46739a1d32565337d3cda0d7f55cb1294b779ea8556977d23d67e155859133e2c78dafa5e933f2e0923869a0182 + languageName: node + linkType: hard + "@noahnu/eslint-config@workspace:packages/eslint-config": version: 0.0.0-use.local resolution: "@noahnu/eslint-config@workspace:packages/eslint-config" @@ -1387,6 +1413,20 @@ __metadata: languageName: unknown linkType: soft +"@noahnu/eslint-import-resolver-require@npm:^0.0.5": + version: 0.0.5 + resolution: "@noahnu/eslint-import-resolver-require@npm:0.0.5" + dependencies: + debug: "npm:^4.3.4" + eslint-import-resolver-node: "npm:^0.3.9" + peerDependencies: + eslint-plugin-import: ">= 2.0.0" + bin: + eslint-import-resolver-require: ./lib/bin.js + checksum: 10c0/1a31c97b91d3fdd79744e07664df2e984ace61d39e482ec2efd29fd2e8a12365d8f41dfd5326894d39d095316891866d9bccef22e766683ed4271e130c1f5360 + languageName: node + linkType: hard + "@noahnu/eslint-import-resolver-require@workspace:^0.0.5, @noahnu/eslint-import-resolver-require@workspace:packages/eslint-import-resolver-require": version: 0.0.0-use.local resolution: "@noahnu/eslint-import-resolver-require@workspace:packages/eslint-import-resolver-require" @@ -1420,12 +1460,10 @@ __metadata: "@monoweave/cli": "npm:^1.2.0" "@monoweave/plugin-github": "npm:^2.1.0" "@monoweave/types": "npm:^1.1.0" + "@noahnu/eslint-config": "npm:^1.0.0" "@tophat/commitizen-adapter": "npm:^1.0.2" "@tophat/commitlint-config": "npm:^1.0.2" "@tophat/conventional-changelog-config": "npm:^1.0.1" - "@tophat/eslint-config": "npm:^9.0.0" - "@tophat/eslint-import-resolver-require": "npm:^1.0.0" - "@tophat/jest-resolver": "npm:^0.1.0" "@types/jest": "npm:^29.5.12" "@types/node": "npm:^20.12.2" "@typescript-eslint/eslint-plugin": "npm:^7.4.0" @@ -1442,8 +1480,6 @@ __metadata: eslint-plugin-jest: "npm:^27.9.0" eslint-plugin-jsx-a11y: "npm:^6.8.0" eslint-plugin-prettier: "npm:^5.1.3" - eslint-plugin-react: "npm:^7.34.1" - eslint-plugin-react-hooks: "npm:^4.6.0" husky: "npm:^9.0.11" jest: "npm:^29.7.0" jest-junit: "npm:^16.0.0" @@ -1711,59 +1747,6 @@ __metadata: languageName: node linkType: hard -"@tophat/eslint-config@npm:^9.0.0": - version: 9.0.0 - resolution: "@tophat/eslint-config@npm:9.0.0" - dependencies: - "@tophat/eslint-import-resolver-require": "npm:^1.0.0" - eslint-import-resolver-node: "npm:^0.3.9" - eslint-import-resolver-typescript: "npm:^3.6.1" - peerDependencies: - "@tanstack/eslint-plugin-query": ">=4.29.0" - "@tophat/eslint-import-resolver-require": ^1.0.0 - "@typescript-eslint/eslint-plugin": ">=6.7.3" - "@typescript-eslint/parser": ">=6.7.3" - eslint: ">=8.36.0" - eslint-config-prettier: ">=9.0.0" - eslint-import-resolver-node: ">=0.3.9" - eslint-import-resolver-typescript: ">=3.6.1" - eslint-plugin-import: ">=2.27.5" - eslint-plugin-jest: ">=27.2.1" - eslint-plugin-jsx-a11y: ">=6.7.1" - eslint-plugin-prettier: ">=5.0.0" - eslint-plugin-react: ">=7.32.2" - eslint-plugin-react-hooks: ">=4.6.0" - prettier: ">=3.0.0" - typescript: ">=5.2.2" - peerDependenciesMeta: - "@tanstack/eslint-plugin-query": - optional: true - eslint-plugin-jsx-a11y: - optional: true - eslint-plugin-react: - optional: true - eslint-plugin-react-hooks: - optional: true - checksum: 10c0/24376bbe80e2664332640b588b14f2d644b9756965d6ef2daf4e790f595e470c48dd75f06b0d80715193df860295fcdea1836a790f31bc4da544ad842bf91087 - languageName: node - linkType: hard - -"@tophat/eslint-import-resolver-require@npm:^1.0.0": - version: 1.0.0 - resolution: "@tophat/eslint-import-resolver-require@npm:1.0.0" - peerDependencies: - eslint-plugin-import: ">= 2.0.0" - checksum: 10c0/14829f4cf07f1d5e38efbe19fd29238eeccdf1ea8c67c6664c632d779b29bbc8d901e2118e62cebe2956a70635795f7f071f404defa30bbcbb564251641fe6d4 - languageName: node - linkType: hard - -"@tophat/jest-resolver@npm:^0.1.0": - version: 0.1.0 - resolution: "@tophat/jest-resolver@npm:0.1.0" - checksum: 10c0/539208c8b5a6cf7f212d3791cef019c6d2b68a91a6f3d1e557f0a16321bc812b82cb6cbb6eef8a9206d59c5b52dfb41e66238bcec24989b67ed3f18cdc28f13c - languageName: node - linkType: hard - "@tsconfig/node10@npm:^1.0.7": version: 1.0.9 resolution: "@tsconfig/node10@npm:1.0.9" @@ -3112,20 +3095,6 @@ __metadata: languageName: node linkType: hard -"array.prototype.findlast@npm:^1.2.4": - version: 1.2.5 - resolution: "array.prototype.findlast@npm:1.2.5" - dependencies: - call-bind: "npm:^1.0.7" - define-properties: "npm:^1.2.1" - es-abstract: "npm:^1.23.2" - es-errors: "npm:^1.3.0" - es-object-atoms: "npm:^1.0.0" - es-shim-unscopables: "npm:^1.0.2" - checksum: 10c0/ddc952b829145ab45411b9d6adcb51a8c17c76bf89c9dd64b52d5dffa65d033da8c076ed2e17091779e83bc892b9848188d7b4b33453c5565e65a92863cb2775 - languageName: node - linkType: hard - "array.prototype.findlastindex@npm:^1.2.3": version: 1.2.3 resolution: "array.prototype.findlastindex@npm:1.2.3" @@ -3163,31 +3132,6 @@ __metadata: languageName: node linkType: hard -"array.prototype.toreversed@npm:^1.1.2": - version: 1.1.2 - resolution: "array.prototype.toreversed@npm:1.1.2" - dependencies: - call-bind: "npm:^1.0.2" - define-properties: "npm:^1.2.0" - es-abstract: "npm:^1.22.1" - es-shim-unscopables: "npm:^1.0.0" - checksum: 10c0/2b7627ea85eae1e80ecce665a500cc0f3355ac83ee4a1a727562c7c2a1d5f1c0b4dd7b65c468ec6867207e452ba01256910a2c0b41486bfdd11acf875a7a3435 - languageName: node - linkType: hard - -"array.prototype.tosorted@npm:^1.1.3": - version: 1.1.3 - resolution: "array.prototype.tosorted@npm:1.1.3" - dependencies: - call-bind: "npm:^1.0.5" - define-properties: "npm:^1.2.1" - es-abstract: "npm:^1.22.3" - es-errors: "npm:^1.1.0" - es-shim-unscopables: "npm:^1.0.2" - checksum: 10c0/a27e1ca51168ecacf6042901f5ef021e43c8fa04b6c6b6f2a30bac3645cd2b519cecbe0bc45db1b85b843f64dc3207f0268f700b4b9fbdec076d12d432cf0865 - languageName: node - linkType: hard - "arraybuffer.prototype.slice@npm:^1.0.3": version: 1.0.3 resolution: "arraybuffer.prototype.slice@npm:1.0.3" @@ -4414,7 +4358,7 @@ __metadata: languageName: node linkType: hard -"es-abstract@npm:^1.22.1, es-abstract@npm:^1.22.3, es-abstract@npm:^1.23.0, es-abstract@npm:^1.23.2": +"es-abstract@npm:^1.22.1, es-abstract@npm:^1.22.3, es-abstract@npm:^1.23.0": version: 1.23.3 resolution: "es-abstract@npm:1.23.3" dependencies: @@ -4477,14 +4421,14 @@ __metadata: languageName: node linkType: hard -"es-errors@npm:^1.1.0, es-errors@npm:^1.2.1, es-errors@npm:^1.3.0": +"es-errors@npm:^1.2.1, es-errors@npm:^1.3.0": version: 1.3.0 resolution: "es-errors@npm:1.3.0" checksum: 10c0/0a61325670072f98d8ae3b914edab3559b6caa980f08054a3b872052640d91da01d38df55df797fcc916389d77fc92b8d5906cf028f4db46d7e3003abecbca85 languageName: node linkType: hard -"es-iterator-helpers@npm:^1.0.15, es-iterator-helpers@npm:^1.0.17": +"es-iterator-helpers@npm:^1.0.15": version: 1.0.18 resolution: "es-iterator-helpers@npm:1.0.18" dependencies: @@ -4526,7 +4470,7 @@ __metadata: languageName: node linkType: hard -"es-shim-unscopables@npm:^1.0.0, es-shim-unscopables@npm:^1.0.2": +"es-shim-unscopables@npm:^1.0.0": version: 1.0.2 resolution: "es-shim-unscopables@npm:1.0.2" dependencies: @@ -4717,43 +4661,6 @@ __metadata: languageName: node linkType: hard -"eslint-plugin-react-hooks@npm:^4.6.0": - version: 4.6.0 - resolution: "eslint-plugin-react-hooks@npm:4.6.0" - peerDependencies: - eslint: ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 - checksum: 10c0/58c7e10ea5792c33346fcf5cb4024e14837035ce412ff99c2dcb7c4f903dc9b17939078f80bfef826301ce326582c396c00e8e0ac9d10ac2cde2b42d33763c65 - languageName: node - linkType: hard - -"eslint-plugin-react@npm:^7.34.1": - version: 7.34.1 - resolution: "eslint-plugin-react@npm:7.34.1" - dependencies: - array-includes: "npm:^3.1.7" - array.prototype.findlast: "npm:^1.2.4" - array.prototype.flatmap: "npm:^1.3.2" - array.prototype.toreversed: "npm:^1.1.2" - array.prototype.tosorted: "npm:^1.1.3" - doctrine: "npm:^2.1.0" - es-iterator-helpers: "npm:^1.0.17" - estraverse: "npm:^5.3.0" - jsx-ast-utils: "npm:^2.4.1 || ^3.0.0" - minimatch: "npm:^3.1.2" - object.entries: "npm:^1.1.7" - object.fromentries: "npm:^2.0.7" - object.hasown: "npm:^1.1.3" - object.values: "npm:^1.1.7" - prop-types: "npm:^15.8.1" - resolve: "npm:^2.0.0-next.5" - semver: "npm:^6.3.1" - string.prototype.matchall: "npm:^4.0.10" - peerDependencies: - eslint: ^3 || ^4 || ^5 || ^6 || ^7 || ^8 - checksum: 10c0/7c61b1314d37a4ac2f2474f9571f801f1a1a5d81dcd4abbb5d07145406518722fb792367267757ee116bde254be9753242d6b93c9619110398b3fe1746e4848c - languageName: node - linkType: hard - "eslint-scope@npm:^5.1.1": version: 5.1.1 resolution: "eslint-scope@npm:5.1.1" @@ -4875,7 +4782,7 @@ __metadata: languageName: node linkType: hard -"estraverse@npm:^5.1.0, estraverse@npm:^5.2.0, estraverse@npm:^5.3.0": +"estraverse@npm:^5.1.0, estraverse@npm:^5.2.0": version: 5.3.0 resolution: "estraverse@npm:5.3.0" checksum: 10c0/1ff9447b96263dec95d6d67431c5e0771eb9776427421260a3e2f0fdd5d6bd4f8e37a7338f5ad2880c9f143450c9b1e4fc2069060724570a49cf9cf0312bd107 @@ -6952,7 +6859,7 @@ __metadata: languageName: node linkType: hard -"jsx-ast-utils@npm:^2.4.1 || ^3.0.0, jsx-ast-utils@npm:^3.3.5": +"jsx-ast-utils@npm:^3.3.5": version: 3.3.5 resolution: "jsx-ast-utils@npm:3.3.5" dependencies: @@ -7720,17 +7627,6 @@ __metadata: languageName: node linkType: hard -"object.hasown@npm:^1.1.3": - version: 1.1.4 - resolution: "object.hasown@npm:1.1.4" - dependencies: - define-properties: "npm:^1.2.1" - es-abstract: "npm:^1.23.2" - es-object-atoms: "npm:^1.0.0" - checksum: 10c0/f23187b08d874ef1aea060118c8259eb7f99f93c15a50771d710569534119062b90e087b92952b2d0fb1bb8914d61fb0b43c57fb06f622aaad538fe6868ab987 - languageName: node - linkType: hard - "object.values@npm:^1.1.6, object.values@npm:^1.1.7": version: 1.1.7 resolution: "object.values@npm:1.1.7" @@ -8080,7 +7976,7 @@ __metadata: languageName: node linkType: hard -"prop-types@npm:^15.6.2, prop-types@npm:^15.8.1": +"prop-types@npm:^15.6.2": version: 15.8.1 resolution: "prop-types@npm:15.8.1" dependencies: @@ -8385,19 +8281,6 @@ __metadata: languageName: node linkType: hard -"resolve@npm:^2.0.0-next.5": - version: 2.0.0-next.5 - resolution: "resolve@npm:2.0.0-next.5" - dependencies: - is-core-module: "npm:^2.13.0" - path-parse: "npm:^1.0.7" - supports-preserve-symlinks-flag: "npm:^1.0.0" - bin: - resolve: bin/resolve - checksum: 10c0/a6c33555e3482ea2ec4c6e3d3bf0d78128abf69dca99ae468e64f1e30acaa318fd267fb66c8836b04d558d3e2d6ed875fe388067e7d8e0de647d3c21af21c43a - languageName: node - linkType: hard - "resolve@patch:resolve@npm%3A^1.10.0#optional!builtin, resolve@patch:resolve@npm%3A^1.20.0#optional!builtin, resolve@patch:resolve@npm%3A^1.22.4#optional!builtin": version: 1.22.8 resolution: "resolve@patch:resolve@npm%3A1.22.8#optional!builtin::version=1.22.8&hash=c3c19d" @@ -8411,19 +8294,6 @@ __metadata: languageName: node linkType: hard -"resolve@patch:resolve@npm%3A^2.0.0-next.5#optional!builtin": - version: 2.0.0-next.5 - resolution: "resolve@patch:resolve@npm%3A2.0.0-next.5#optional!builtin::version=2.0.0-next.5&hash=c3c19d" - dependencies: - is-core-module: "npm:^2.13.0" - path-parse: "npm:^1.0.7" - supports-preserve-symlinks-flag: "npm:^1.0.0" - bin: - resolve: bin/resolve - checksum: 10c0/78ad6edb8309a2bfb720c2c1898f7907a37f858866ce11a5974643af1203a6a6e05b2fa9c53d8064a673a447b83d42569260c306d43628bff5bb101969708355 - languageName: node - linkType: hard - "responselike@npm:^2.0.0": version: 2.0.1 resolution: "responselike@npm:2.0.1" @@ -8607,7 +8477,7 @@ __metadata: languageName: node linkType: hard -"set-function-name@npm:^2.0.1, set-function-name@npm:^2.0.2": +"set-function-name@npm:^2.0.1": version: 2.0.2 resolution: "set-function-name@npm:2.0.2" dependencies: @@ -8642,7 +8512,7 @@ __metadata: languageName: node linkType: hard -"side-channel@npm:^1.0.4, side-channel@npm:^1.0.6": +"side-channel@npm:^1.0.4": version: 1.0.6 resolution: "side-channel@npm:1.0.6" dependencies: @@ -8892,26 +8762,6 @@ __metadata: languageName: node linkType: hard -"string.prototype.matchall@npm:^4.0.10": - version: 4.0.11 - resolution: "string.prototype.matchall@npm:4.0.11" - dependencies: - call-bind: "npm:^1.0.7" - define-properties: "npm:^1.2.1" - es-abstract: "npm:^1.23.2" - es-errors: "npm:^1.3.0" - es-object-atoms: "npm:^1.0.0" - get-intrinsic: "npm:^1.2.4" - gopd: "npm:^1.0.1" - has-symbols: "npm:^1.0.3" - internal-slot: "npm:^1.0.7" - regexp.prototype.flags: "npm:^1.5.2" - set-function-name: "npm:^2.0.2" - side-channel: "npm:^1.0.6" - checksum: 10c0/915a2562ac9ab5e01b7be6fd8baa0b2b233a0a9aa975fcb2ec13cc26f08fb9a3e85d5abdaa533c99c6fc4c5b65b914eba3d80c4aff9792a4c9fed403f28f7d9d - languageName: node - linkType: hard - "string.prototype.trim@npm:^1.2.9": version: 1.2.9 resolution: "string.prototype.trim@npm:1.2.9"