-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* - simplify plugin setup Signed-off-by: Jakob Fischl <[email protected]> * - fix react configuration discarding import-x settings Signed-off-by: Jakob Fischl <[email protected]> * bump version Signed-off-by: Jakob Fischl <[email protected]> --------- Signed-off-by: Jakob Fischl <[email protected]> Signed-off-by: Jakob Fischl <[email protected]>
- Loading branch information
1 parent
bc9f222
commit 6b59697
Showing
19 changed files
with
320 additions
and
339 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
|
||
# Custom Configuration | ||
These configs are intended to be used as is without any customization, but we do recognize that some projects may have special requirements. | ||
|
||
## Custom tsconfig files | ||
By default, only tsconfig files in the root directory are used. You can provide custom tsconfig files like this: | ||
|
||
```ts | ||
// this applies to all configs, not just typescript | ||
import { cloudflightTypescriptConfig } from '@cloudflight/eslint-plugin-typescript'; | ||
|
||
export default cloudflightTypescriptConfig({ | ||
rootDirectory: import.meta.dirname, | ||
tsConfigFiles: ['./packages/*/tsconfig.json', './packages/*/tsconfig.spec.json'], | ||
}); | ||
``` | ||
**Try to keep the list of TSConfig files as short as possible, they have a negative effect on performance** | ||
|
||
## Adding additional plugins | ||
Add additional things before the Cloudflight config, this prevents these plugins from overriding important config options. | ||
|
||
**Note:** This might not work for all Plugins | ||
|
||
```ts | ||
// this applies to all configs, not just typescript | ||
import { cloudflightTypescriptConfig } from '@cloudflight/eslint-plugin-typescript'; | ||
|
||
export default [ | ||
...storybook.configs['flat/recommended'], | ||
...cloudflightTypescriptConfig({ | ||
rootDirectory: import.meta.dirname, | ||
tsConfigFiles: ['./packages/*/tsconfig.json', './packages/*/tsconfig.spec.json'], | ||
}) | ||
]; | ||
``` | ||
|
||
## Disabling rules | ||
|
||
```ts | ||
// this applies to all configs, not just typescript | ||
import { cloudflightTypescriptConfig } from '@cloudflight/eslint-plugin-typescript'; | ||
|
||
export default [ | ||
...cloudflightTypescriptConfig({ | ||
rootDirectory: import.meta.dirname, | ||
tsConfigFiles: ['./packages/*/tsconfig.json', './packages/*/tsconfig.spec.json'], | ||
}), | ||
{ | ||
rules: { | ||
'no-magic-numbers': 'off', | ||
}, | ||
}, | ||
]; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,5 @@ | ||
import {cloudflightTypescriptFormatConfig} from '@cloudflight/eslint-plugin-typescript'; | ||
import {includeIgnoreFile} from '@eslint/compat'; | ||
import {dirname, resolve} from 'node:path'; | ||
import {fileURLToPath} from 'node:url'; | ||
import tseslint from 'typescript-eslint'; | ||
|
||
const filename = fileURLToPath(import.meta.url); | ||
const directory = dirname(filename); | ||
const gitignorePath = resolve(directory, '.gitignore'); | ||
|
||
export default tseslint.config( | ||
includeIgnoreFile(gitignorePath), | ||
...cloudflightTypescriptFormatConfig, | ||
); | ||
export default cloudflightTypescriptFormatConfig({ | ||
rootDirectory: import.meta.dirname, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.