-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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: Introduce Knip #18005
chore: Introduce Knip #18005
Changes from 13 commits
7831590
8a222a9
76dd0e8
9750f81
0889b43
1d890c2
f7d6b38
4c7bc82
bb6de2b
5baac95
055091c
e0781b0
e655f22
23c4416
d6f4138
f04054a
b5881ee
9aa8c63
83de5e5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
JoshuaKGoldberg marked this conversation as resolved.
Show resolved
Hide resolved
|
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,46 @@ | ||||||||
{ | ||||||||
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. It would be helpful if you could explain what all of this does. 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. Most of the configuration comes down to providing entry files in order for Knip to do its thing. This repository is much like a monorepo, but without explicitly defined |
||||||||
"workspaces": { | ||||||||
".": { | ||||||||
// These entries are complementary to the ones found in package.json | ||||||||
"entry": [ | ||||||||
"lib/rules/index.js", | ||||||||
JoshuaKGoldberg marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||
"tools/internal-rules/index.js", | ||||||||
JoshuaKGoldberg marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||
"tools/update-rule-types.js", | ||||||||
JoshuaKGoldberg marked this conversation as resolved.
Show resolved
Hide resolved
JoshuaKGoldberg marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||
// https://github.com/webpro/knip/issues/464 | ||||||||
// Remove when Knip has a wdio plugin | ||||||||
"wdio.conf.js" | ||||||||
], | ||||||||
"project": ["{conf,lib,tools}/**/*.js"], | ||||||||
"mocha": { | ||||||||
"entry": [ | ||||||||
"tests/{bin,conf,lib,tools}/**/*.js", // see Makefile.js | ||||||||
"tests/_utils/test-lazy-loading-rules.js" | ||||||||
], | ||||||||
JoshuaKGoldberg marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||
"project": ["tests/**/*.js"] | ||||||||
}, | ||||||||
"ignore": [ | ||||||||
// If Knip would consider exports as named, their usage is too dynamic: globals[`es${ecmaVersion}`] | ||||||||
// An alternative is to add `__esModule: true` to the export and we can remove it here from the ignores: | ||||||||
"conf/globals.js", | ||||||||
JoshuaKGoldberg marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||
// These contain unresolved imports and other oddities: | ||||||||
"tests/bench/large.js", | ||||||||
"tests/lib/rule-tester/rule-tester.js", | ||||||||
"tests/performance/jshint.js", | ||||||||
JoshuaKGoldberg marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||
// Many are required using dynamic paths such as `fs.readFileSync(path.join())`: | ||||||||
"tests/fixtures/**" | ||||||||
], | ||||||||
"ignoreDependencies": [ | ||||||||
"c8", | ||||||||
// Ignore until Knip has a wdio plugin: | ||||||||
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.
Suggested change
|
||||||||
"@wdio/*", | ||||||||
"rollup-plugin-node-polyfills" | ||||||||
] | ||||||||
}, | ||||||||
"docs": { | ||||||||
"ignore": ["src/assets/js/search.js", "_examples/**"] | ||||||||
}, | ||||||||
// Workspaces with default configs: | ||||||||
"packages/*": {}, | ||||||||
"tools/internal-rules": {} | ||||||||
} | ||||||||
} |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,11 @@ | ||
"use strict"; | ||
|
||
const { Linter } = require("./linter"); | ||
const { interpolate } = require("./interpolate"); | ||
const SourceCodeFixer = require("./source-code-fixer"); | ||
|
||
module.exports = { | ||
Linter, | ||
|
||
// For testers. | ||
SourceCodeFixer, | ||
interpolate | ||
SourceCodeFixer | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
"use strict"; | ||
|
||
const RuleTester = require("./rule-tester"); | ||
|
||
module.exports = { | ||
RuleTester: require("./rule-tester") | ||
RuleTester | ||
}; |
This file was deleted.
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.
[Style] Unrelated changes to whitespace all around?