Skip to content
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

feat: add import order sorting via prettier #1392

Merged
merged 26 commits into from
May 17, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
added eslint back
  • Loading branch information
FinnDore committed May 9, 2023
commit 01de8cd792f5b1dcc14f44a3e5a54d065b4c7a27
1 change: 0 additions & 1 deletion cli/src/installers/dependencyVersionMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ export const dependencyVersionMap = {
"@ianvs/prettier-plugin-sort-imports": "^3.7.2",

// Eslint
eslint: "^8.36.0",
"eslint-config-next": "^13.4.1",
} as const;
export type AvailableDependencies = keyof typeof dependencyVersionMap;
11 changes: 7 additions & 4 deletions cli/src/installers/eslint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,19 @@ import { addPackageDependency } from "~/utils/addPackageDependency.js";
import { type Installer } from "./index.js";

export const eslint: Installer = ({ projectDir }) => {
const configDir = path.join(PKG_ROOT, "template/extras/config");

addPackageDependency({
dependencies: ["eslint", "eslint-config-next"],
dependencies: ["eslint-config-next"],
devMode: true,
projectDir,
});

const configDir = path.join(PKG_ROOT, "template/extras/config");

// Remove the default config
fs.rmSync(path.join(projectDir, "_eslintrc.cjs"));

fs.copySync(
path.join(configDir, "_eslintrc.cjs"),
path.join(projectDir, "eslintrc.cjs"),
path.join(projectDir, ".eslintrc.cjs"),
);
};
2 changes: 1 addition & 1 deletion cli/src/installers/prettier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const prettier: Installer = ({ projectDir, packages }) => {
);
} else {
fs.copySync(
path.join(PKG_ROOT, "template/extras/config/prettier.config.cjs"),
path.join(PKG_ROOT, "template/extras/config/_prettier.config.cjs"),
path.join(projectDir, "prettier.config.cjs"),
);
}
Expand Down
4 changes: 4 additions & 0 deletions cli/template/base/_eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/** @type {import("eslint").Linter.Config} */
const config = {};

module.exports = config;
1 change: 0 additions & 1 deletion cli/template/base/package.json