@onerepo/plugin-eslint
Installation
Section titled InstallationConfiguration
Section titled Configurationeslint()
Section titled eslint()Include the eslint
plugin in your oneRepo plugin setup:
Parameters
Section titled ParametersParameter | Type |
---|---|
opts | Options |
Options
Section titled OptionsOptions for configuring the ESLint plugin for oneRepo.
Type declaration
Section titled Type declarationextensions?
Section titled extensions?List of file extensions (without the .
) that ESLint should operate across. Omit this if using the new flat configuration.
githubAnnotate?
Section titled githubAnnotate?When true
or unset and run in GitHub Actions, any files failing format checks will be annotated with an error in the GitHub user interface.
name?
Section titled name?The name of the eslint command. You might change this to 'lint'
or ['lint', 'eslint']
to keep things more familiar for most developers.
warnings?
Section titled warnings?Control the ESLint setting default to suppress warnings and only report errors.
Recommended tasks
Section titled Recommended tasksIf you’re also running Prettier, it is important to run ESLint _before__ Prettier. Do this by creating sequential tasks: an array of tasks within the serial
tasks array:
Commands
Section titled Commandsone eslint
Section titled one eslintAliases: one lint
Run eslint across files and Workspaces.
Option | Type | Description |
---|---|---|
--add | boolean | Add modified files after write to the git stage. |
--affected | boolean | Select all affected Workspaces. If no other inputs are chosen, this will default to true . |
--all, -a | boolean | Run across all Workspaces |
--cache | boolean , default: true | Use cache if available |
--extensions | array | Make ESLint check files given these extensions. |
--files, -f | array | Determine Workspaces from specific files |
--fix | boolean , default: true | Apply auto-fixes if possible |
--pretty | boolean , default: true | Control ESLint’s --color flag. |
--staged | boolean | Use files on the git stage to calculate affected files or Workspaces. When unset or --no-staged , changes will be calculated from the entire branch, since its fork point. |
--warnings, --warn | boolean , default: true | Report warnings from ESLint. |
--workspaces, -w | array | List of Workspace names to run against |
Advanced options
Option | Type | Description |
---|---|---|
--from-ref | string | Git ref to start looking for affected files or Workspaces |
--github-annotate | boolean , default: true | Annotate files in GitHub with errors when failing lint checks in GitHub Actions |
--show-advanced | boolean | Pair with --help to show advanced options. |
--through-ref | string | Git ref to start looking for affected files or Workspaces |