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

Fix typos #156

Merged
merged 3 commits into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
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
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
5 changes: 4 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,7 @@ dist

megalinter-reports/

pnpm-lock.yaml
pnpm-lock.yaml

# MDX v3
*.mdx
AndreaPontrandolfo marked this conversation as resolved.
Show resolved Hide resolved
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.<br>
Please use the discussions tab or the issues tab for new rules proposals.

Expand All @@ -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.<br>
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`.<br>
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. <br>
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.<br>
The full list of the plugins used is [here](https://www.eslint-config-sheriff.dev/docs/eslint-plugins).
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