-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
chore: add knip #8192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: add knip #8192
Changes from all commits
d0896c6
f3bd554
2d7afbc
a9b3dd1
77d0279
f074fd7
27163a2
919867d
3f3abce
2b53d17
6f32a3e
47d2703
56a6d1f
8b9e441
b24377d
5a1255a
64cb8c4
91c9909
1348b52
e7a204c
5d37ea8
85df506
eea474d
de23db8
19e22c5
5025e67
6dad589
fda5336
e7a7201
aab75cf
e062dd1
3ebf3e7
9a605ca
9e2e27d
7879dd0
9975158
2c5ee6b
f54babd
36fa481
814c162
5c56b50
4d163a2
263b528
7e58b47
c7c1114
c65abae
7bea876
81a6914
3506094
2188ef8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
'use strict'; | ||
|
||
// @ts-check | ||
const { getJestProjects } = require('@nx/jest'); | ||
|
||
/** @type {import('@jest/types').Config.InitialOptions} */ | ||
module.exports = { | ||
projects: getJestProjects(), | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
import type { KnipConfig } from 'knip'; | ||
|
||
export default { | ||
rules: { | ||
classMembers: 'off', | ||
duplicates: 'off', | ||
enumMembers: 'off', | ||
exports: 'off', | ||
nsExports: 'off', | ||
nsTypes: 'off', | ||
types: 'off', | ||
unresolved: 'off', | ||
}, | ||
workspaces: { | ||
'.': { | ||
ignoreDependencies: [ | ||
'@babel/code-frame', | ||
'@babel/core', | ||
'@babel/eslint-parser', | ||
'@babel/parser', | ||
'@babel/types', | ||
'@nx/workspace', | ||
'cross-fetch', | ||
'glob', | ||
'husky', | ||
'jest-specific-snapshot', | ||
'make-dir', | ||
'ncp', | ||
'tmp', | ||
|
||
// imported in eslint.config.js | ||
'@typescript-eslint/utils', | ||
// imported in eslint.config.mjs | ||
'@typescript-eslint/eslint-plugin-internal', | ||
JoshuaKGoldberg marked this conversation as resolved.
Show resolved
Hide resolved
|
||
], | ||
entry: ['tools/release/changelog-renderer.js'], | ||
ignoreBinaries: [ | ||
// https://github.com/webpro/knip/issues/433 | ||
'stylelint', | ||
], | ||
}, | ||
'packages/ast-spec': { | ||
ignore: [ | ||
'src/**/fixtures/**', | ||
'tests/*.type-test.ts', | ||
// @typescript-eslint/typescript-estree is not listed in dependencies to avoid circular dependency errors | ||
// You can check a more detailed explanation in this file | ||
'tests/util/parsers/typescript-estree-import.ts', | ||
], | ||
}, | ||
'packages/eslint-plugin': { | ||
ignore: ['tests/fixtures/**'], | ||
}, | ||
'packages/eslint-plugin-internal': { | ||
ignore: ['tests/fixtures/**'], | ||
}, | ||
'packages/integration-tests': { | ||
ignore: ['fixtures/**'], | ||
}, | ||
'packages/parser': { | ||
ignore: ['tests/fixtures/**'], | ||
}, | ||
'packages/scope-manager': { | ||
ignore: ['tests/fixtures/**'], | ||
}, | ||
'packages/type-utils': { | ||
ignore: ['tests/fixtures/**'], | ||
}, | ||
'packages/typescript-estree': { | ||
entry: ['src/use-at-your-own-risk.ts'], | ||
ignore: ['tests/fixtures/**'], | ||
}, | ||
'packages/website': { | ||
entry: [ | ||
'docusaurus.config.mts', | ||
auvred marked this conversation as resolved.
Show resolved
Hide resolved
|
||
'src/pages/**/*.tsx', | ||
|
||
// imported in MDX docs | ||
'src/components/**/*.tsx', | ||
|
||
// used by Docusaurus | ||
'src/theme/**/*.tsx', | ||
'src/theme/prism-include-languages.js', | ||
], | ||
ignoreDependencies: [ | ||
// used in MDX docs | ||
'raw-loader', | ||
|
||
// it's imported only as type (esquery types are forked and defined in packages/website/typings/esquery.d.ts) | ||
'esquery', | ||
|
||
'@babel/runtime', | ||
'@docusaurus/mdx-loader', | ||
'@docusaurus/types', | ||
'@docusaurus/plugin-content-docs', | ||
'@docusaurus/theme-search-algolia', | ||
'@docusaurus/ExecutionEnvironment', | ||
'@docusaurus/Link', | ||
'@docusaurus/router', | ||
'@docusaurus/useDocusaurusContext', | ||
'@docusaurus/useBaseUrl', | ||
'@docusaurus/BrowserOnly', | ||
'@docusaurus/theme-classic', | ||
'@generated/docusaurus.config', | ||
'^@theme/.*', | ||
'^@theme-original/.*', | ||
], | ||
}, | ||
'packages/website-eslint': { | ||
ignoreDependencies: [ | ||
// virtual module | ||
'vt', | ||
], | ||
entry: [ | ||
'src/index.js', | ||
'src/mock/assert.js', | ||
'src/mock/empty.js', | ||
'src/mock/eslint-rules.js', | ||
'src/mock/eslint.js', | ||
'src/mock/lru-cache.js', | ||
'src/mock/path.js', | ||
'src/mock/typescript.js', | ||
'src/mock/util.js', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You know, as a followup I bet we could switch these over to plain |
||
], | ||
}, | ||
'tools/dummypkg': {}, | ||
}, | ||
} satisfies KnipConfig; |
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -53,39 +53,36 @@ | |||
"clean": "tsc -b tsconfig.build.json --clean", | ||||
"postclean": "rimraf dist && rimraf coverage", | ||||
"format": "prettier --write \"./**/*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}\" --ignore-path ../../.prettierignore", | ||||
"generate:breaking-changes": "yarn tsx tools/generate-breaking-changes.mts", | ||||
"generate:breaking-changes": "tsx tools/generate-breaking-changes.mts", | ||||
"generate:configs": "npx nx run repo-tools:generate-configs", | ||||
"lint": "npx nx lint", | ||||
"test": "cross-env NODE_OPTIONS=\"--experimental-vm-modules\" jest --coverage --logHeapUsage", | ||||
"test-single": "cross-env NODE_OPTIONS=\"--experimental-vm-modules\" jest --no-coverage", | ||||
"typecheck": "tsc -p tsconfig.json --noEmit" | ||||
"typecheck": "tsc --noEmit" | ||||
}, | ||||
"dependencies": { | ||||
"@eslint-community/regexpp": "^4.10.0", | ||||
"@typescript-eslint/scope-manager": "7.8.0", | ||||
"@typescript-eslint/type-utils": "7.8.0", | ||||
"@typescript-eslint/utils": "7.8.0", | ||||
"@typescript-eslint/visitor-keys": "7.8.0", | ||||
"debug": "^4.3.4", | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unused after #3658 |
||||
"graphemer": "^1.4.0", | ||||
"ignore": "^5.3.1", | ||||
"natural-compare": "^1.4.0", | ||||
"semver": "^7.6.0", | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unused after #8377 |
||||
"ts-api-utils": "^1.3.0" | ||||
}, | ||||
"devDependencies": { | ||||
"@types/debug": "*", | ||||
"@types/marked": "*", | ||||
"@jest/types": "29.6.3", | ||||
"@types/marked": "^5.0.2", | ||||
"@types/mdast": "^4.0.3", | ||||
"@types/natural-compare": "*", | ||||
"@typescript-eslint/rule-schema-to-typescript-types": "7.8.0", | ||||
"@typescript-eslint/rule-tester": "7.8.0", | ||||
"ajv": "^6.12.6", | ||||
"chalk": "^5.3.0", | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||
"cross-env": "^7.0.3", | ||||
"cross-fetch": "*", | ||||
"eslint": "*", | ||||
"grapheme-splitter": "^1.0.4", | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unused after faea3ff8b |
||||
"espree": "^10.0.1", | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Required by typescript-eslint/packages/eslint-plugin/tests/rules/no-use-before-define.test.ts Line 721 in e44a1a2
|
||||
"jest": "29.7.0", | ||||
"jest-specific-snapshot": "^8.0.0", | ||||
"json-schema": "*", | ||||
|
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -44,7 +44,7 @@ | |||
"pretest-eslint-base": "tsc -b tsconfig.build.json", | ||||
"test-eslint-base": "mocha --require source-map-support/register ./tests/eslint-base/eslint-base.test.js", | ||||
"test": "npx jest --coverage", | ||||
"typecheck": "tsc -p tsconfig.json --noEmit" | ||||
"typecheck": "tsc --noEmit" | ||||
}, | ||||
"//": "NOTE - AJV is out-of-date, but it's intentionally synced with ESLint - https://github.com/eslint/eslint/blob/ad9dd6a933fd098a0d99c6a9aa059850535c23ee/package.json#L70", | ||||
"dependencies": { | ||||
|
@@ -59,9 +59,13 @@ | |||
"eslint": "^8.56.0" | ||||
}, | ||||
"devDependencies": { | ||||
"@jest/types": "29.6.3", | ||||
"@types/lodash.merge": "4.6.9", | ||||
"@typescript-eslint/parser": "7.8.0", | ||||
"chai": "^4.4.1", | ||||
"eslint-visitor-keys": "^4.0.0", | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. typescript-eslint/packages/rule-tester/tests/eslint-base/fixtures/enhanced-parser2.js Line 6 in e44a1a2
|
||||
"espree": "^10.0.1", | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||||
"esprima": "^4.0.1", | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||||
"mocha": "^10.4.0", | ||||
"sinon": "^16.1.3", | ||||
"source-map-support": "^0.5.21", | ||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Praise] Nice, +1 to getting
// @ts-check
in here.