forked from kitschpatrol/shared-config
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ecfead4
commit e272b6f
Showing
7 changed files
with
81 additions
and
72 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 |
---|---|---|
@@ -1,6 +1,12 @@ | ||
import { cspellConfig } from '@envsa/cspell-config'; | ||
|
||
export default cspellConfig({ | ||
ignorePaths: ['/packages/*/init/*.json', '/packages/*/bin', './test/fixtures/input', './test/fixtures/output-fixed-auto', './packages/eslint-config/src/typegen.d.ts'], | ||
words: [] | ||
ignorePaths: [ | ||
'/packages/*/init/*.json', | ||
'/packages/*/bin', | ||
'./test/fixtures/input', | ||
'./test/fixtures/output-fixed-auto', | ||
'./packages/eslint-config/src/typegen.d.ts', | ||
], | ||
words: [], | ||
}); |
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,67 +1,67 @@ | ||
import { | ||
type CommandDefinition, | ||
DESCRIPTION, | ||
getCosmiconfigCommand, | ||
} from '../../../src/command-builder.js' | ||
import { getFilePathAtProjectRoot } from '../../../src/path-utils.js' | ||
type CommandDefinition, | ||
DESCRIPTION, | ||
getCosmiconfigCommand, | ||
} from '../../../src/command-builder.js'; | ||
import { getFilePathAtProjectRoot } from '../../../src/path-utils.js'; | ||
|
||
// TODO bad idea? | ||
const sharedOptions = [ | ||
'--log-level=warn', | ||
'--plugin=@prettier/plugin-php', | ||
'--plugin=@prettier/plugin-xml', | ||
'--plugin=prettier-plugin-packagejson', | ||
'--plugin=prettier-plugin-sh', | ||
'--plugin=prettier-plugin-svelte', | ||
'--plugin=prettier-plugin-tailwindcss', | ||
// Have to resolve to the project root for ignore to work when calling prettier in subdirectories | ||
`--ignore-path=${getFilePathAtProjectRoot('.gitignore') ?? '.gitignore'}`, | ||
`--ignore-path=${getFilePathAtProjectRoot('.prettierignore') ?? '.prettierignore'}`, | ||
] | ||
'--log-level=warn', | ||
'--plugin=@prettier/plugin-php', | ||
'--plugin=@prettier/plugin-xml', | ||
'--plugin=prettier-plugin-packagejson', | ||
'--plugin=prettier-plugin-sh', | ||
'--plugin=prettier-plugin-svelte', | ||
'--plugin=prettier-plugin-tailwindcss', | ||
// Have to resolve to the project root for ignore to work when calling prettier in subdirectories | ||
`--ignore-path=${getFilePathAtProjectRoot('.gitignore') ?? '.gitignore'}`, | ||
`--ignore-path=${getFilePathAtProjectRoot('.prettierignore') ?? '.prettierignore'}`, | ||
]; | ||
|
||
export const commandDefinition: CommandDefinition = { | ||
commands: { | ||
fix: { | ||
commands: [ | ||
{ | ||
name: 'prettier', | ||
optionFlags: [...sharedOptions, '--write'], | ||
receivePositionalArguments: true, | ||
}, | ||
], | ||
description: `Format files according to your Prettier configuration. ${DESCRIPTION.fileRun}`, | ||
positionalArgumentDefault: '.', | ||
positionalArgumentMode: 'optional', | ||
}, | ||
init: { | ||
configFile: 'prettier.config.js', | ||
configPackageJson: { | ||
prettier: '@envsa/prettier-config', | ||
}, | ||
locationOptionFlag: true, | ||
}, | ||
lint: { | ||
commands: [ | ||
{ | ||
name: 'prettier', | ||
optionFlags: [...sharedOptions, '--check'], | ||
receivePositionalArguments: true, | ||
}, | ||
], | ||
description: `Check that files are formatted according to your Prettier configuration. ${DESCRIPTION.fileRun}`, | ||
positionalArgumentDefault: '.', | ||
positionalArgumentMode: 'optional', | ||
}, | ||
printConfig: { | ||
// See also --find-config-path and --file-info options for fancier per-file approaches... | ||
commands: [getCosmiconfigCommand('prettier')], | ||
description: `Print the effective Prettier configuration. ${DESCRIPTION.packageSearch}. ${DESCRIPTION.monorepoSearch}.`, | ||
positionalArgumentMode: 'none', | ||
}, | ||
}, | ||
description: "Envsa's Prettier shared configuration tools.", | ||
logColor: 'blue', | ||
logPrefix: '[Prettier]', | ||
name: 'envsa-prettier', | ||
order: 9, | ||
} | ||
commands: { | ||
fix: { | ||
commands: [ | ||
{ | ||
name: 'prettier', | ||
optionFlags: [...sharedOptions, '--write'], | ||
receivePositionalArguments: true, | ||
}, | ||
], | ||
description: `Format files according to your Prettier configuration. ${DESCRIPTION.fileRun}`, | ||
positionalArgumentDefault: '.', | ||
positionalArgumentMode: 'optional', | ||
}, | ||
init: { | ||
configFile: 'prettier.config.js', | ||
configPackageJson: { | ||
prettier: '@envsa/prettier-config', | ||
}, | ||
locationOptionFlag: true, | ||
}, | ||
lint: { | ||
commands: [ | ||
{ | ||
name: 'prettier', | ||
optionFlags: [...sharedOptions, '--check'], | ||
receivePositionalArguments: true, | ||
}, | ||
], | ||
description: `Check that files are formatted according to your Prettier configuration. ${DESCRIPTION.fileRun}`, | ||
positionalArgumentDefault: '.', | ||
positionalArgumentMode: 'optional', | ||
}, | ||
printConfig: { | ||
// See also --find-config-path and --file-info options for fancier per-file approaches... | ||
commands: [getCosmiconfigCommand('prettier')], | ||
description: `Print the effective Prettier configuration. ${DESCRIPTION.packageSearch}. ${DESCRIPTION.monorepoSearch}.`, | ||
positionalArgumentMode: 'none', | ||
}, | ||
}, | ||
description: "Envsa's Prettier shared configuration tools.", | ||
logColor: 'blue', | ||
logPrefix: '[Prettier]', | ||
name: 'envsa-prettier', | ||
order: 9, | ||
}; |
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