mirror of
https://github.com/lucide-icons/lucide.git
synced 2026-08-29 11:38:25 +02:00
* feat(ci): added custom prettier plugin for icon SVG files * feat(ci): added custom prettier plugin for icon SVG files * feat(ci): replace prettier plugin implementation with one based on svgo * fix(ci): fix linting issues in prettier plugin * Allow fill in path to fix podcast icon * Format code --------- Co-authored-by: Eric Fennis <eric.fennis@gmail.com>
25 lines
783 B
JavaScript
25 lines
783 B
JavaScript
/**
|
|
* @param {string[]} filenames
|
|
* @returns {string}
|
|
*/
|
|
const filenamesToAjvOption = (filenames) => filenames.map((filename) => `-d ${filename}`).join(' ');
|
|
|
|
/** @satisfies {import('lint-staged').Config} */
|
|
const config = {
|
|
'icons/*.svg': (filenames) => [
|
|
'node ./scripts/optimizeStagedSvgs.mts',
|
|
'node ./scripts/generateNextJSAliases.mts',
|
|
`prettier --write ${filenames.join(' ')}`,
|
|
],
|
|
'icons/*.json': (filenames) => [
|
|
`ajv --spec=draft2020 -s icon.schema.json ${filenamesToAjvOption(filenames)}`,
|
|
`prettier --write ${filenames.join(' ')}`,
|
|
],
|
|
'categories/*.json': (filenames) => [
|
|
`ajv --spec=draft2020 -s category.schema.json ${filenamesToAjvOption(filenames)}`,
|
|
`prettier --write ${filenames.join(' ')}`,
|
|
],
|
|
};
|
|
|
|
export default config;
|