Skip to content

Commit c8a7981

Browse files
committed
Restore package.json require() in plugin.ts.
1 parent 2c2be13 commit c8a7981

File tree

2 files changed

+6
-25
lines changed

2 files changed

+6
-25
lines changed

scripts/docs.ts

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -186,39 +186,21 @@ const buildTilde = async () => {
186186
].join("\n");
187187
};
188188

189-
async function processReadme() {
190-
markdownMagic(path.join(__dirname, "..", "README.md"), {
189+
async function run() {
190+
await markdownMagic(path.join(__dirname, "..", "README.md"), {
191191
transforms: {
192192
RULES: () => buildRulesTable(ruleTableRows),
193193
TILDE: () => buildTilde(),
194194
},
195195
failOnMissingTransforms: true,
196196
});
197-
}
198-
199-
async function processRuleDocs() {
200-
// const docRoot = path.resolve(__dirname, "..", "docs");
201-
202-
markdownMagic(path.resolve(__dirname, "..", "docs", "*.md"), {
197+
await markdownMagic(path.resolve(__dirname, "..", "docs", "*.md"), {
203198
transforms: {
204199
HEADER: ({ srcPath }: any) => buildHeader(path.basename(srcPath)),
205200
OPTIONS: ({ srcPath }: any) => buildOptions(path.basename(srcPath)),
206201
CASES: ({ content, srcPath }: any) => buildCases(content, path.basename(srcPath)),
207202
},
208203
failOnMissingTransforms: true,
209204
});
210-
211-
// const docFiles = (await fs.readdir(docRoot)).filter((p) => p.endsWith(".md"));
212-
// for (const docFile of docFiles) {
213-
// markdownMagic(path.join(docRoot, docFile), {
214-
// transforms: {
215-
// HEADER: ({ content, srcPath }: any) => buildHeader(path.basename(srcPath)),
216-
// OPTIONS: ({ content, srcPath }: any) => buildOptions(path.basename(srcPath)),
217-
// CASES: ({ content, srcPath }: any) => buildCases(content, path.basename(srcPath)),
218-
// },
219-
// failOnMissingTransforms: true,
220-
// });
221-
// }
222205
}
223-
224-
Promise.all([processReadme(), processRuleDocs()]);
206+
run();

src/plugin.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,8 @@ import noArrayHandlers from "./rules/no-array-handlers";
2929
// import validateJsxNesting from "./rules/validate-jsx-nesting";
3030

3131
// Use require() so that `package.json` doesn't get copied to `dist`
32-
33-
import packageJson from "../package.json";
34-
const { name, version } = packageJson; // require("../package.json");
32+
// eslint-disable-next-line @typescript-eslint/no-require-imports
33+
const { name, version } = require("../package.json");
3534
const meta = { name, version };
3635

3736
const allRules = {

0 commit comments

Comments
 (0)