Skip to content

Commit

Permalink
feat: ✨ add auto detection to enable configurations
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmy-guzman committed Apr 13, 2024
1 parent a0315ab commit a65831b
Show file tree
Hide file tree
Showing 13 changed files with 372 additions and 50 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
15 changes: 1 addition & 14 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Up @@ -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": {
Expand All @@ -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",
Expand All @@ -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"
Expand Down
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

0 comments on commit a65831b

Please sign in to comment.