Skip to content

Commit

Permalink
Closer to tests passing
Browse files Browse the repository at this point in the history
  • Loading branch information
lydell committed Jul 28, 2023
1 parent 7a3dfed commit 4e645b4
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 16 deletions.
6 changes: 6 additions & 0 deletions eslint.base.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ const babelParser = require("@babel/eslint-parser");
const flowtype = require("eslint-plugin-flowtype");
const globals = require("globals");
const google = require("eslint-config-google");
const prettier = require("eslint-plugin-prettier");
const react = require("eslint-plugin-react");
const standard = require("eslint-plugin-standard");
const typescriptEslint = require("@typescript-eslint/eslint-plugin");
const unicorn = require("eslint-plugin-unicorn");
const vue = require("eslint-plugin-vue");
const eslintrcBase = require("./.eslintrc.base");
Expand All @@ -32,8 +35,11 @@ module.exports = [
google,
{
plugins: {
"@typescript-eslint": typescriptEslint,
"babel": babelOld,
"@babel": babelNew,
prettier,
standard,
},
},
{
Expand Down
33 changes: 17 additions & 16 deletions test/rules.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ const childProcess = require("child_process");
const fs = require("fs");
const path = require("path");
const config = require("../");
const eslintConfig = require("../.eslintrc");
const eslintConfigBase = require("../.eslintrc.base");
const flatEslintConfig = require("../eslint.config");
const flatEslintConfigBase = require("../eslint.base.config");

const ROOT = path.join(__dirname, "..");
const TEST_CONFIG_DIR = path.join(ROOT, "test-config");
Expand Down Expand Up @@ -64,24 +60,29 @@ function createTestConfigDir() {
path.join(TEST_CONFIG_DIR, "prettier.js")
);

fs.writeFileSync(
path.join(TEST_CONFIG_DIR, ".eslintrc.js"),
`module.exports = ${JSON.stringify(eslintConfig, null, 2)};`
fs.copyFileSync(
path.join(ROOT, ".eslintrc.js"),
path.join(TEST_CONFIG_DIR, ".eslintrc.js")
);

fs.writeFileSync(
path.join(TEST_CONFIG_DIR, ".eslintrc.base.js"),
`module.exports = ${JSON.stringify(eslintConfigBase, null, 2)};`
fs.copyFileSync(
path.join(ROOT, ".eslintrc.base.js"),
path.join(TEST_CONFIG_DIR, ".eslintrc.base.js")
);

fs.writeFileSync(
path.join(TEST_CONFIG_DIR, "eslint.config.js"),
`module.exports = ${JSON.stringify(flatEslintConfig, null, 2)};`
fs.copyFileSync(
path.join(ROOT, "eslint.config.js"),
path.join(TEST_CONFIG_DIR, "eslint.config.js")
);

fs.writeFileSync(
path.join(TEST_CONFIG_DIR, "eslint.base.config.js"),
`module.exports = ${JSON.stringify(flatEslintConfigBase, null, 2)};`
fs.copyFileSync(
path.join(ROOT, "eslint.base.config.js"),
path.join(TEST_CONFIG_DIR, "eslint.base.config.js")
);

fs.copyFileSync(
path.join(ROOT, ".eslintignore"),
path.join(TEST_CONFIG_DIR, ".eslintignore")
);
}

Expand Down

0 comments on commit 4e645b4

Please sign in to comment.