From e5a81854b75d1dc635c77b94b73651dc0126c3f6 Mon Sep 17 00:00:00 2001 From: Eli <88557639+lishaduck@users.noreply.github.com> Date: Tue, 9 Jul 2024 11:11:15 -0500 Subject: [PATCH 1/3] fix: up readme Remove a space. Capitalize I. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8e58a36d..f6047b47 100755 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ You can follow the latest updates on the project in the [official blog](https:// ### Suggestions -I consider Sheriff a community effort, and i welcome suggestions and contributions of any kind. +I consider Sheriff a community effort, and I welcome suggestions and contributions of any kind. Feel free to propose suggestions about new rules to implement, or tweaks to existing rules.
Please use the discussions tab or the issues tab for new rules proposals. @@ -49,5 +49,5 @@ Please use the discussions tab or the issues tab for new rules proposals. For some of this configuration, [eslint-config-red](https://github.com/GrosSacASac/JavaScript-Set-Up/blob/master/js/red-javascript-style-guide/index.js) was partially used as a base.
Additionally, inspiration was drawn from [eslint-config-airbnb](https://github.com/airbnb/javascript/tree/master/packages/eslint-config-airbnb) for some of the rules in `no-restricted-syntax`.
-I don't take any attribution for the rules in the various eslint-plugins used here (except for the few that I personally created). Please consider starring the respective projects for the awesome work their authors made. Sheriff wouldn't be possible without their efforts.
+I don't take any attribution for the rules in the various eslint-plugins used here (except for the few that I personally created). Please consider starring the respective projects for the awesome work their authors made. Sheriff wouldn't be possible without their efforts.
The full list of the plugins used is [here](https://www.eslint-config-sheriff.dev/docs/eslint-plugins). From 15730a59335e385555936e64e083f39fd2a972b3 Mon Sep 17 00:00:00 2001 From: Eli <88557639+lishaduck@users.noreply.github.com> Date: Tue, 9 Jul 2024 11:12:59 -0500 Subject: [PATCH 2/3] fix: turn off mdx formatting --- .prettierignore | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.prettierignore b/.prettierignore index d986b412..8d85f3fe 100644 --- a/.prettierignore +++ b/.prettierignore @@ -39,4 +39,7 @@ dist megalinter-reports/ -pnpm-lock.yaml \ No newline at end of file +pnpm-lock.yaml + +# MDX v3 +*.mdx From 1859c47143b42d4372d3a374c3214c0d4829692e Mon Sep 17 00:00:00 2001 From: Eli <88557639+lishaduck@users.noreply.github.com> Date: Tue, 9 Jul 2024 11:17:33 -0500 Subject: [PATCH 3/3] fix!: typo in config --- .changeset/lucky-insects-sort.md | 7 +++++++ apps/docs-website/docs/configuration.mdx | 16 ++++++++-------- .../docs/performance-considerations.mdx | 2 +- .../eslint-config-sheriff/src/getBaseConfig.ts | 2 +- .../src/getExportableConfig.ts | 6 +++--- packages/sheriff-types/src/index.ts | 2 +- 6 files changed, 21 insertions(+), 14 deletions(-) create mode 100644 .changeset/lucky-insects-sort.md diff --git a/.changeset/lucky-insects-sort.md b/.changeset/lucky-insects-sort.md new file mode 100644 index 00000000..b9f0dd72 --- /dev/null +++ b/.changeset/lucky-insects-sort.md @@ -0,0 +1,7 @@ +--- +'eslint-config-sheriff': major +'@sherifforg/types': major +'docs-website': patch +--- + +fix!: typo in config diff --git a/apps/docs-website/docs/configuration.mdx b/apps/docs-website/docs/configuration.mdx index 4b51856c..34b5d70d 100644 --- a/apps/docs-website/docs/configuration.mdx +++ b/apps/docs-website/docs/configuration.mdx @@ -330,18 +330,18 @@ module.exports = defineFlatConfig([...sheriff(sheriffOptions)]); -### `pathsOveriddes` +### `pathsOverrides` As outlined in the [criteria](./core-philosophy/criteria.md) page, Sheriff comes with sensible defaults. However, as your project grows, your team may come across the need to override some of these defaults. This option lets you do just that. ```ts title="API" -pathsOveriddes: { +pathsOverrides: { tsconfigLocation: string | string[]; tests: string[]; } ``` -#### `pathsOveriddes.tsconfigLocation` +#### `pathsOverrides.tsconfigLocation` By default, Sheriff will use the `project: true` option to locate the `tsconfig.json` of your project. @@ -365,7 +365,7 @@ const sheriffOptions = { playwright: false, jest: false, vitest: false, - pathsOveriddes: { + pathsOverrides: { // highlight-next-line tsconfigLocation: "./tsconfig.eslint.json", }, @@ -388,7 +388,7 @@ const sheriffOptions = { playwright: false, jest: false, vitest: false, - pathsOveriddes: { + pathsOverrides: { // highlight-next-line tsconfigLocation: "./tsconfig.eslint.json", }, @@ -400,7 +400,7 @@ module.exports = defineFlatConfig([...sheriff(sheriffOptions)]); -#### `pathsOveriddes.tests` +#### `pathsOverrides.tests` By default, Sheriff will apply Jest or Vitest rules only on specific files. @@ -428,7 +428,7 @@ const sheriffOptions = { playwright: false, jest: false, vitest: false, - pathsOveriddes: { + pathsOverrides: { // highlight-start tests: [ "**/*.mySpecialName.{js,mjs,cjs,ts,mts,cts}", @@ -456,7 +456,7 @@ const sheriffOptions = { playwright: false, jest: false, vitest: false, - pathsOveriddes: { + pathsOverrides: { // highlight-start tests: [ "**/*.mySpecialName.{js,mjs,cjs,ts,mts,cts,jsx,tsx,mtsx,mjsx}", diff --git a/apps/docs-website/docs/performance-considerations.mdx b/apps/docs-website/docs/performance-considerations.mdx index 7aa28bbe..8d4e5b53 100644 --- a/apps/docs-website/docs/performance-considerations.mdx +++ b/apps/docs-website/docs/performance-considerations.mdx @@ -122,5 +122,5 @@ Pay special attention to: - [ESLint files and ignore patterns](https://eslint.org/docs/latest/use/configure/configuration-files-new#specifying-files-and-ignores) - [Typescript include and exclude patterns](https://typescript-eslint.io/linting/troubleshooting/performance-troubleshooting/#wide-includes-in-your-tsconfig) - [Sheriff files options](./configuration#files) -- [Sheriff pathsOveriddes options](./configuration#pathsoveriddes) +- [Sheriff pathsOverrides options](./configuration#pathsoverrides) - [wide-globs-in-parseroptionsproject](https://typescript-eslint.io/linting/typed-linting/monorepos/#wide-globs-in-parseroptionsproject) diff --git a/packages/eslint-config-sheriff/src/getBaseConfig.ts b/packages/eslint-config-sheriff/src/getBaseConfig.ts index 060df3de..d61b8c7c 100644 --- a/packages/eslint-config-sheriff/src/getBaseConfig.ts +++ b/packages/eslint-config-sheriff/src/getBaseConfig.ts @@ -27,7 +27,7 @@ import { getBaseEslintHandPickedRules } from './handpickedRules/getBaseEslintHan import { getLanguageOptionsTypescript } from './utils/getLanguageOptionsTypescript'; export const getBaseConfig = (userConfigChoices: SheriffSettings) => { - const customTSConfigPath = userConfigChoices.pathsOveriddes?.tsconfigLocation; + const customTSConfigPath = userConfigChoices.pathsOverrides?.tsconfigLocation; const { noRestrictedSyntaxOverride } = userConfigChoices; const hasReact = Boolean(userConfigChoices.react); diff --git a/packages/eslint-config-sheriff/src/getExportableConfig.ts b/packages/eslint-config-sheriff/src/getExportableConfig.ts index 00ffbfb4..85fd6f28 100644 --- a/packages/eslint-config-sheriff/src/getExportableConfig.ts +++ b/packages/eslint-config-sheriff/src/getExportableConfig.ts @@ -30,7 +30,7 @@ export const getExportableConfig = ( // we insert reactConfig this way because it's an array. It's an array because it contains multiple configs, currently: react, react-hooks, react-a11y and react-refresh. exportableConfig = [ ...exportableConfig, - ...getReactConfig(userConfigChoices.pathsOveriddes?.tsconfigLocation), + ...getReactConfig(userConfigChoices.pathsOverrides?.tsconfigLocation), ]; } @@ -46,14 +46,14 @@ export const getExportableConfig = ( if (userConfigChoices.jest) { exportableConfig.push( - getJestConfig(userConfigChoices.pathsOveriddes?.tests), + getJestConfig(userConfigChoices.pathsOverrides?.tests), ); } if (userConfigChoices.vitest) { exportableConfig.push( //@ts-expect-error - getVitestConfig(userConfigChoices.pathsOveriddes?.tests), + getVitestConfig(userConfigChoices.pathsOverrides?.tests), ); } diff --git a/packages/sheriff-types/src/index.ts b/packages/sheriff-types/src/index.ts index 412de7e9..425e96b8 100644 --- a/packages/sheriff-types/src/index.ts +++ b/packages/sheriff-types/src/index.ts @@ -89,7 +89,7 @@ export interface SheriffSettings extends Partial { /** * This parameter allows you to override the paths for some Sheriff settings. */ - pathsOveriddes?: { + pathsOverrides?: { /** * With this setting, if you have multiple tsconfig.json files in your project (like tsconfig.json, tsconfig.eslint.json, tsconfig.node.json, etc...) you can specify which config Sheriff will pickup. You can also specify a list of paths, see: https://typescript-eslint.io/linting/typed-linting/monorepos/#one-tsconfigjson-per-package-and-an-optional-one-in-the-root. */