Skip to content

Commit

Permalink
fix!: typo in config
Browse files Browse the repository at this point in the history
  • Loading branch information
lishaduck committed Jul 9, 2024
1 parent 15730a5 commit 645e220
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 14 deletions.
7 changes: 7 additions & 0 deletions .changeset/lucky-insects-sort.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'eslint-config-sheriff': major
'@sherifforg/types': major
'docs-website': patch
---

fix!: typo in config
16 changes: 8 additions & 8 deletions apps/docs-website/docs/configuration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -330,18 +330,18 @@ module.exports = defineFlatConfig([...sheriff(sheriffOptions)]);
</TabItem>
</Tabs>

### `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.

Expand All @@ -365,7 +365,7 @@ const sheriffOptions = {
playwright: false,
jest: false,
vitest: false,
pathsOveriddes: {
pathsOverrides: {
// highlight-next-line
tsconfigLocation: "./tsconfig.eslint.json",
},
Expand All @@ -388,7 +388,7 @@ const sheriffOptions = {
playwright: false,
jest: false,
vitest: false,
pathsOveriddes: {
pathsOverrides: {
// highlight-next-line
tsconfigLocation: "./tsconfig.eslint.json",
},
Expand All @@ -400,7 +400,7 @@ module.exports = defineFlatConfig([...sheriff(sheriffOptions)]);
</TabItem>
</Tabs>

#### `pathsOveriddes.tests`
#### `pathsOverrides.tests`

By default, Sheriff will apply Jest or Vitest rules only on specific files.

Expand Down Expand Up @@ -428,7 +428,7 @@ const sheriffOptions = {
playwright: false,
jest: false,
vitest: false,
pathsOveriddes: {
pathsOverrides: {
// highlight-start
tests: [
"**/*.mySpecialName.{js,mjs,cjs,ts,mts,cts}",
Expand Down Expand Up @@ -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}",
Expand Down
2 changes: 1 addition & 1 deletion apps/docs-website/docs/performance-considerations.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion packages/eslint-config-sheriff/src/getBaseConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
6 changes: 3 additions & 3 deletions packages/eslint-config-sheriff/src/getExportableConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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),
];
}

Expand All @@ -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),
);
}

Expand Down
2 changes: 1 addition & 1 deletion packages/sheriff-types/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export interface SheriffSettings extends Partial<SheriffConfigurablePlugins> {
/**
* 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.
*/
Expand Down

0 comments on commit 645e220

Please sign in to comment.