Skip to content

Commit

Permalink
feat(plugins): added eslint-plugin-remeda support
Browse files Browse the repository at this point in the history
Fixes #209
  • Loading branch information
AndreaPontrandolfo committed Sep 16, 2024
1 parent f2bab54 commit 5dc6228
Show file tree
Hide file tree
Showing 26 changed files with 137 additions and 20 deletions.
1 change: 1 addition & 0 deletions apps/config-validation-playground/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { defineFlatConfig } from 'eslint-define-config';
const sheriffOptions = {
react: true,
lodash: true,
remeda: true,
next: true,
playwright: true,
jest: false,
Expand Down
20 changes: 20 additions & 0 deletions apps/docs-website/docs/configuration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ const sheriffOptions = {
next: false,
astro: false,
lodash: false,
remeda: false,
playwright: false,
jest: false,
vitest: false,
Expand All @@ -60,6 +61,7 @@ const sheriffOptions: SheriffSettings = {
next: false,
astro: false,
lodash: false,
remeda: false,
playwright: false,
jest: false,
vitest: false,
Expand Down Expand Up @@ -90,6 +92,7 @@ const sheriffOptions = {
next: false,
astro: false,
lodash: false,
remeda: false,
playwright: false,
jest: false,
vitest: false,
Expand Down Expand Up @@ -119,6 +122,7 @@ const sheriffOptions: SheriffSettings = {
next: false,
astro: false,
lodash: false,
remeda: false,
playwright: false,
jest: false,
vitest: false,
Expand Down Expand Up @@ -152,6 +156,7 @@ const sheriffOptions = {
next: false,
astro: false,
lodash: false,
remeda: false,
playwright: false,
jest: false,
vitest: false,
Expand Down Expand Up @@ -181,6 +186,7 @@ const sheriffOptions: SheriffSettings = {
next: false,
astro: false,
lodash: false,
remeda: false,
playwright: false,
jest: false,
vitest: false,
Expand Down Expand Up @@ -245,6 +251,7 @@ const sheriffOptions = {
next: false,
astro: false,
lodash: false,
remeda: false,
playwright: false,
jest: false,
vitest: false,
Expand All @@ -271,6 +278,7 @@ const sheriffOptions: SheriffSettings = {
next: false,
astro: false,
lodash: false,
remeda: false,
playwright: false,
jest: false,
vitest: false,
Expand Down Expand Up @@ -305,6 +313,7 @@ const sheriffOptions = {
next: false,
astro: false,
lodash: false,
remeda: false,
playwright: false,
jest: false,
vitest: false,
Expand All @@ -331,6 +340,7 @@ const sheriffOptions: SheriffSettings = {
next: false,
astro: false,
lodash: false,
remeda: false,
playwright: false,
jest: false,
vitest: false,
Expand Down Expand Up @@ -380,6 +390,7 @@ const sheriffOptions = {
next: false,
astro: false,
lodash: false,
remeda: false,
playwright: false,
jest: false,
vitest: false,
Expand All @@ -405,6 +416,7 @@ const sheriffOptions: SheriffSettings = {
next: false,
astro: false,
lodash: false,
remeda: false,
playwright: false,
jest: false,
vitest: false,
Expand Down Expand Up @@ -446,6 +458,7 @@ const sheriffOptions = {
next: false,
astro: false,
lodash: false,
remeda: false,
playwright: false,
jest: false,
vitest: false,
Expand Down Expand Up @@ -476,6 +489,7 @@ const sheriffOptions: SheriffSettings = {
next: false,
astro: false,
lodash: false,
remeda: false,
playwright: false,
jest: false,
vitest: false,
Expand Down Expand Up @@ -520,6 +534,7 @@ const sheriffOptions = {
next: false,
astro: false,
lodash: false,
remeda: false,
playwright: false,
jest: false,
vitest: false,
Expand Down Expand Up @@ -553,6 +568,7 @@ const sheriffOptions: SheriffSettings = {
next: false,
astro: false,
lodash: false,
remeda: false,
playwright: false,
jest: false,
vitest: false,
Expand Down Expand Up @@ -595,6 +611,7 @@ const sheriffOptions = {
next: false,
astro: false,
lodash: false,
remeda: false,
playwright: false,
jest: false,
vitest: false
Expand Down Expand Up @@ -629,6 +646,7 @@ const sheriffOptions: SheriffSettings = {
next: false,
astro: false,
lodash: false,
remeda: false,
playwright: false,
jest: false,
vitest: false
Expand Down Expand Up @@ -673,6 +691,7 @@ const sheriffOptions = {
next: false,
astro: false,
lodash: false,
remeda: false,
playwright: false,
jest: false,
vitest: false
Expand Down Expand Up @@ -706,6 +725,7 @@ const sheriffOptions: SheriffSettings = {
next: false,
astro: false,
lodash: false,
remeda: false,
playwright: false,
jest: false,
vitest: false
Expand Down
1 change: 1 addition & 0 deletions apps/docs-website/docs/eslint-plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ sidebar_position: 7
- [@vitest/eslint-plugin](https://github.com/vitest-dev/eslint-plugin-vitest)
- [eslint-plugin-import](https://github.com/import-js/eslint-plugin-import) with [eslint-import-resolver-typescript](https://github.com/import-js/eslint-import-resolver-typescript)
- [eslint-plugin-lodash-f](https://github.com/AndreaPontrandolfo/eslint-plugin-lodash) (my fork of [eslint-plugin-lodash](https://github.com/wix/eslint-plugin-lodash))
- [eslint-plugin-remeda](https://github.com/AndreaPontrandolfo/eslint-plugin-remeda)
- [@next/eslint-plugin-next](https://www.npmjs.com/package/@next/eslint-plugin-next)
- [eslint-plugin-playwright](https://github.com/playwright-community/eslint-plugin-playwright)
- [eslint-plugin-storybook](https://github.com/storybookjs/eslint-plugin-storybook)
Expand Down
2 changes: 2 additions & 0 deletions apps/docs-website/docs/migration-guide.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ const sheriffOptions = {
next: false,
astro: false,
lodash: false,
remeda: false,
playwright: false,
jest: false,
vitest: false,
Expand All @@ -60,6 +61,7 @@ const sheriffOptions: SheriffSettings = {
next: false,
astro: false,
lodash: false,
remeda: false,
playwright: false,
jest: false,
vitest: false,
Expand Down
2 changes: 2 additions & 0 deletions apps/docs-website/docs/performance-considerations.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ const sheriffOptions = {
next: false,
astro: false,
lodash: false,
remeda: false,
playwright: false,
jest: false,
vitest: false,
Expand Down Expand Up @@ -80,6 +81,7 @@ const sheriffOptions: SheriffSettings = {
next: false,
astro: false,
lodash: false,
remeda: false,
playwright: false,
jest: false,
vitest: false,
Expand Down
3 changes: 3 additions & 0 deletions apps/docs-website/docs/setup/manual-setup.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Follow these steps:
next: false,
astro: false,
lodash: false,
remeda: false,
playwright: false,
jest: false,
vitest: false,
Expand All @@ -51,6 +52,7 @@ Follow these steps:
next: false,
astro: false,
lodash: false,
remeda: false,
playwright: false,
jest: false,
vitest: false,
Expand Down Expand Up @@ -85,6 +87,7 @@ Follow these steps:
next: false,
astro: false,
lodash: false,
remeda: false,
playwright: false,
jest: false,
vitest: false,
Expand Down
23 changes: 12 additions & 11 deletions apps/docs-website/docs/techs.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ sidebar_position: 4

# 🖥️ Techs

- [Eslint](https://eslint.org/)
- [Prettier](https://prettier.io/)
- [Typescript](https://www.typescriptlang.org/) (_out of the box support_)
- [Storybook](https://storybook.js.org/) (_out of the box support_)
- [Astro](https://astro.build/) (_opt-in_)
- [React](https://reactjs.org/) (_opt-in_)
- [Next](https://nextjs.org/) (_opt-in_)
- [Lodash](https://lodash.com/) (_opt-in_)
- [Playwright](https://playwright.dev/) (_opt-in_)
- [Jest](https://jestjs.io/) (_opt-in_)
- [Vitest](https://vitest.dev/) (_opt-in_)
- [Eslint](https://eslint.org)
- [Prettier](https://prettier.io)
- [Typescript](https://www.typescriptlang.org) (_out of the box support_)
- [Storybook](https://storybook.js.org) (_out of the box support_)
- [Astro](https://astro.build) (_opt-in_)
- [React](https://reactjs.org) (_opt-in_)
- [Next](https://nextjs.org) (_opt-in_)
- [Lodash](https://lodash.com) (_opt-in_)
- [Remeda](https://remedajs.com) (_opt-in_)
- [Playwright](https://playwright.dev) (_opt-in_)
- [Jest](https://jestjs.io) (_opt-in_)
- [Vitest](https://vitest.dev) (_opt-in_)
1 change: 1 addition & 0 deletions apps/docs-website/eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { flat, flatCodeBlocks, createRemarkProcessor } from 'eslint-plugin-mdx';
const sheriffOptions = {
react: true,
lodash: true,
remeda: false,
next: false,
astro: false,
playwright: false,
Expand Down
11 changes: 11 additions & 0 deletions apps/docs-website/src/components/ComparisonTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ interface TableEntry {
TSDoc: '✅' | '❌';
Import: '✅' | '❌';
Lodash: '✅' | '❌';
Remeda: '✅' | '❌';
Nextjs: '✅' | '❌';
Jest: '✅' | '❌';
Vitest: '✅' | '❌';
Expand Down Expand Up @@ -67,6 +68,7 @@ const entriesTable: EntriesTable = {
TSDoc: '✅',
Import: '✅',
Lodash: '✅',
Remeda: '✅',
Nextjs: '✅',
Jest: '✅',
Vitest: '✅',
Expand Down Expand Up @@ -97,6 +99,7 @@ const entriesTable: EntriesTable = {
TSDoc: '❌',
Import: '✅',
Lodash: '❌',
Remeda: '❌',
Nextjs: '❌',
Jest: '❌',
Vitest: '❌',
Expand Down Expand Up @@ -127,6 +130,7 @@ const entriesTable: EntriesTable = {
TSDoc: '❌',
Import: '✅',
Lodash: '❌',
Remeda: '❌',
Nextjs: '❌',
Jest: '❌',
Vitest: '❌',
Expand Down Expand Up @@ -157,6 +161,7 @@ const entriesTable: EntriesTable = {
TSDoc: '❌',
Import: '✅',
Lodash: '❌',
Remeda: '❌',
Nextjs: '❌',
Jest: '❌',
Vitest: '❌',
Expand Down Expand Up @@ -187,6 +192,7 @@ const entriesTable: EntriesTable = {
TSDoc: '❌',
Import: '✅',
Lodash: '❌',
Remeda: '❌',
Nextjs: '✅',
Jest: '❌',
Vitest: '✅',
Expand Down Expand Up @@ -217,6 +223,7 @@ const entriesTable: EntriesTable = {
TSDoc: '❌',
Import: '✅',
Lodash: '❌',
Remeda: '❌',
Nextjs: '❌',
Jest: '❌',
Vitest: '❌',
Expand Down Expand Up @@ -247,6 +254,7 @@ const entriesTable: EntriesTable = {
TSDoc: '❌',
Import: '✅',
Lodash: '✅',
Remeda: '❌',
Nextjs: '✅',
Jest: '✅',
Vitest: '✅',
Expand Down Expand Up @@ -277,6 +285,7 @@ const entriesTable: EntriesTable = {
TSDoc: '❌',
Import: '✅',
Lodash: '❌',
Remeda: '❌',
Nextjs: '✅',
Jest: '❌',
Vitest: '❌',
Expand Down Expand Up @@ -307,6 +316,7 @@ const entriesTable: EntriesTable = {
TSDoc: '❌',
Import: '✅',
Lodash: '❌',
Remeda: '❌',
Nextjs: '✅',
Jest: '✅',
Vitest: '❌',
Expand Down Expand Up @@ -337,6 +347,7 @@ const entriesTable: EntriesTable = {
TSDoc: '❌',
Import: '✅',
Lodash: '❌',
Remeda: '❌',
Nextjs: '❌',
Jest: '✅',
Vitest: '❌',
Expand Down
10 changes: 10 additions & 0 deletions apps/docs-website/src/components/ConfigCombinationForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ interface ConfigCombinationFormProps {
interface FormInputs {
react: boolean;
lodash: boolean;
remeda: boolean;
next: boolean;
playwright: boolean;
vitest: boolean;
Expand Down Expand Up @@ -65,6 +66,15 @@ export const ConfigCombinationForm = ({
/>
<label htmlFor="lodash">Lodash</label>
</div>
<div className={styles.nativeCheckbox}>
<input
{...register('remeda')}
defaultChecked
type="checkbox"
id="remeda"
/>
<label htmlFor="remeda">Remeda</label>
</div>
<div className={styles.nativeCheckbox}>
<input {...register('next')} defaultChecked type="checkbox" id="next" />
<label htmlFor="next">Next</label>
Expand Down
1 change: 1 addition & 0 deletions apps/sheriff-webservices/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { defineFlatConfig } from 'eslint-define-config';
const sheriffOptions = {
react: false,
lodash: true,
remeda: false,
next: false,
astro: false,
playwright: false,
Expand Down
1 change: 1 addition & 0 deletions apps/sheriff-webservices/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"eslint-plugin-react": "^7.35.0",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.3",
"eslint-plugin-remeda": "^1.4.0",
"eslint-plugin-simple-import-sort": "^12.1.0",
"eslint-plugin-sonarjs": "^1.0.4",
"eslint-plugin-storybook": "^0.6.11",
Expand Down
Loading

0 comments on commit 5dc6228

Please sign in to comment.