Skip to content

Commit

Permalink
Merge pull request #67 from ottofeller/add-no-config-flag
Browse files Browse the repository at this point in the history
Add --no-local-confg flag for eslint
  • Loading branch information
gvidon authored Feb 22, 2023
2 parents e44f103 + 7784361 commit 7127779
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ There are two _bin_ files that perform the code checking:
- `ofmt` - prettier formatter. Two options are available:\
`-l, --lint` - a flag to perform checking only. Without the flag `prettier` will rewrite files with fixed formatting.
`-p, --src-path` - defines search path for source code within `format` and `lint` scripts (the scripts added to a project upon installation). Defaults to `./src`. Used only with `install` command.
`-n, --no-local-config` - ignores local eslint config files.
- `olint` - code quality and best practices linter.

## Examples:
Expand Down
5 changes: 4 additions & 1 deletion ofmt/bin/ofmt.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ const args = meow({
flags: {
lint: {type: 'boolean', alias: 'l'},
srcPath: {type: 'string', alias: 'p', default: './src'},
localConfig: {type: 'boolean', alias: 'n', default: true},
},
})

Expand All @@ -68,7 +69,9 @@ if (args.input[0] === 'install') {

;[
`npx prettier --${checkOrWrite} --config ${prettierConfigPath} ${args.input}`,
`npx eslint --ext ${eslintExt} --config ${eslintConfigPath} ${args.flags.lint ? '' : '--fix'} ${args.input}`,
`npx eslint --ext ${eslintExt} --config ${eslintConfigPath} ${args.flags.lint ? '' : '--fix'} ${
args.flags.localConfig ? '' : '--no-eslintrc'
} ${args.input}`,
].forEach((command) => {
exec(command, (error, stdout, stderr) => {
console.log(stdout)
Expand Down

0 comments on commit 7127779

Please sign in to comment.