Skip to content

Commit

Permalink
feat: added linting and formatting of icon and category json files
Browse files Browse the repository at this point in the history
  • Loading branch information
jguddas committed Oct 22, 2023
1 parent 49445aa commit da31b6d
Show file tree
Hide file tree
Showing 4 changed files with 157 additions and 109 deletions.
13 changes: 7 additions & 6 deletions category.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,24 @@
},
"title": "Lucide Icons category schema",
"type": "object",
"additionalProperties": false,
"required": ["$schema", "icon", "title"],
"properties": {
"title": {
"type": "string"
"$schema": {
"const": "../category.schema.json"
},
"description": {
"type": "string"
},
"icon": {
"type": "string"
},
"title": {
"type": "string"
},
"weight": {
"type": "integer"
}
},
"required": [
"title",
"icon"
],
"description": "A JSON Schema for categories defined by Lucide Icons."
}
17 changes: 15 additions & 2 deletions icon.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,17 @@
},
"title": "Lucide Icons icon schema",
"type": "object",
"additionalProperties": false,
"required": ["$schema", "categories", "tags"],
"properties": {
"tags": {
"$schema": {
"const": "../icon.schema.json"
},
"aliases": {
"type": "array",
"items": {
"type": "string"
},
"minItems": 1,
"uniqueItems": true
},
"categories": {
Expand All @@ -33,6 +37,15 @@
"items": {
"type": "string"
},
"minItems": 1,
"uniqueItems": true
},
"tags": {
"type": "array",
"items": {
"type": "string"
},
"minItems": 1,
"uniqueItems": true
}
},
Expand Down
17 changes: 15 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,17 @@
"generate:contributors": "node ./scripts/updateContributors.mjs icons/*.svg",
"generate:nextJSAliases": "node ./scripts/generateNextJSAliases.mjs",
"postinstall": "husky install",
"lint": "eslint --ext .ts,.js,.mjs ./{packages/lucide,scripts}",
"lint:js": "eslint --ext .ts,.js,.mjs ./{packages/lucide,scripts}",
"lint:json:icons": "ajv --spec=draft2020 -s icon.schema.json -d 'icons/*.json' > /dev/null",
"lint:json:categories": "ajv --spec=draft2020 -s category.schema.json -d 'categories/*.json' > /dev/null",
"lint:json": "pnpm run lint:json:icons && pnpm run lint:json:categories",
"lint": "pnpm lint:js lint:json",
"prepare": "husky install",
"gi": "node ./scripts/generate/generateIcons.mjs"
},
"devDependencies": {
"@octokit/rest": "^19.0.13",
"ajv-cli": "^5.0.0",
"eslint": "^8.43.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-prettier": "^8.8.0",
Expand All @@ -52,9 +57,17 @@
"svgson": "^5.2.1"
},
"lint-staged": {
"icons/*.svg":[
"icons/*.svg": [
"node ./scripts/optimizeStagedSvgs.mjs",
"node ./scripts/generateNextJSAliases.mjs"
],
"icons/*.json": [
"ajv --spec=draft2020 -s icon.schema.json -d",
"prettier --write --print-width=0"
],
"categories/*.json": [
"ajv --spec=draft2020 -s category.schema.json -d",
"prettier --write --print-width=0"
]
},
"packageManager": "[email protected]",
Expand Down
Loading

0 comments on commit da31b6d

Please sign in to comment.