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 auto detection to enable configurations #12

Merged
merged 1 commit into from
Apr 13, 2024
Merged
Changes from all commits
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
feat: ✨ add auto detection to enable configurations
jimmy-guzman committed Apr 13, 2024
commit d2d4c88f811c9ee81a4a088291655d73d97dd2b4
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -66,6 +66,14 @@ export default jimmyDotCodes({
});
```

Or you can enable auto detection to enable rules based on a project's dependencies

```js
import jimmyDotCodes from "@jimmy.codes/eslint-config";

export default jimmyDotCodes({ autoDetect: true });
```

#### TypeScript

You can also change the project location which can be helpful for monorepos:
15 changes: 1 addition & 14 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -9,17 +9,4 @@ const jiti = JITI(import.meta.url);
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
const jimmyDotCodes = jiti("./src").default;

export default jimmyDotCodes({
typescript: true,
react: {
utilities: ["@tanstack/query"],
},
testing: {
utilities: ["testing-library"],
},
overrides: [
{
ignores: ["fixtures"],
},
],
});
export default jimmyDotCodes({ autoDetect: true });
6 changes: 6 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -63,6 +63,7 @@
"eslint-plugin-simple-import-sort": "^12.0.0",
"eslint-plugin-testing-library": "^6.2.0",
"globals": "^15.0.0",
"local-pkg": "0.5.0",
"typescript-eslint": "^7.6.0"
},
"devDependencies": {
@@ -74,9 +75,12 @@
"@semantic-release/git": "10.0.1",
"@semantic-release/npm": "12.0.0",
"@semantic-release/release-notes-generator": "13.0.0",
"@tanstack/react-query": "5.29.0",
"@testing-library/react": "15.0.0",
"@types/eslint": "8.56.9",
"@types/eslint__js": "8.42.3",
"@types/node": "20.12.7",
"@types/react": "18.2.75",
"@vitest/coverage-v8": "1.5.0",
"clean-pkg-json": "1.2.0",
"commitlint": "19.2.1",
@@ -87,6 +91,8 @@
"lefthook": "1.6.10",
"pkgroll": "2.0.2",
"prettier": "3.2.5",
"react": "18.2.0",
"react-dom": "18.2.0",
"semantic-release": "23.0.8",
"typescript": "5.4.5",
"vitest": "1.5.0"
140 changes: 129 additions & 11 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions src/configs/commonjs.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import globals from "globals";

import { GLOB_CJS } from "../constants";

export const commonjsConfig = () => {
return [
{
name: "jimmy.codes/commonjs",
files: [GLOB_CJS],
languageOptions: {
globals: globals.commonjs,
},
},
];
};
Loading