Skip to content

Commit 28afad5

Browse files
committed
🔧 Add GLSL linting and formatting configuration
Add comprehensive GLSL development tooling with linting and formatting - Add .glslrc.json configuration with WebGL compatibility settings - Include GLSL extensions and version 4.6 core profile support - Configure warnings for unused variables, functions, and deprecated features - Add prettier-plugin-glsl to .prettierrc for GLSL code formatting - Install GLSL tooling dependencies: glslang-validator, glslify, prettier- plugin-glsl - Add scripts/glsl-lint.js with comprehensive GLSL validation: * Extract and validate GLSL from TypeScript template literals * Check WebGL compatibility and deprecated function usage * Validate syntax, precision qualifiers, and main functions * Detect performance issues like nested loops and division by zero * Provide detailed error reporting with line numbers - Add npm scripts for GLSL formatting and linting: * format:glsl and format:glsl:check for code formatting * lint:glsl and lint:glsl:fix for validation and auto-fixing - Integrate GLSL checks into prepare-release workflow - Add VS Code extension recommendations for GLSL development
1 parent 17ca104 commit 28afad5

File tree

6 files changed

+1786
-226
lines changed

6 files changed

+1786
-226
lines changed

.glslrc.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"version": "4.6",
3+
"profile": "core",
4+
"extensions": [
5+
"GL_EXT_shader_explicit_arithmetic_types",
6+
"GL_EXT_shader_explicit_arithmetic_types_int8",
7+
"GL_EXT_shader_explicit_arithmetic_types_int16",
8+
"GL_EXT_shader_explicit_arithmetic_types_int32",
9+
"GL_EXT_shader_explicit_arithmetic_types_int64",
10+
"GL_EXT_shader_explicit_arithmetic_types_float16",
11+
"GL_EXT_shader_explicit_arithmetic_types_float32",
12+
"GL_EXT_shader_explicit_arithmetic_types_float64"
13+
],
14+
"defines": [
15+
"WEBGL_VERSION=2"
16+
],
17+
"warnings": {
18+
"unused_variables": true,
19+
"unused_functions": true,
20+
"missing_precision": true,
21+
"deprecated_functions": true
22+
}
23+
}

.prettierrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"plugins": ["prettier-plugin-uppercase-doctype"]
2+
"plugins": ["prettier-plugin-uppercase-doctype", "prettier-plugin-glsl"]
33
}

.vscode/extensions.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"recommendations": [
3+
"esbenp.prettier-vscode",
4+
"biomejs.biome",
5+
"bradlc.vscode-tailwindcss",
6+
"ms-vscode.vscode-typescript-next",
7+
"slevesque.shader",
8+
"circledev.glsl-canvas",
9+
"raczzalan.webgl-glsl-editor",
10+
"dtoplak.vscode-glsllint"
11+
],
12+
"unwantedRecommendations": [
13+
"ms-vscode.vscode-eslint"
14+
]
15+
}

0 commit comments

Comments
 (0)