eslint-plugin-typegpu
v0.10.0
Published
TypeGPU specific linting rules for ESLint
Readme
eslint-plugin-typegpu
TypeGPU specific linting rules for ESLint.
Installation
npm add -D eslint-plugin-typegpu
After installing, the plugin needs to be configured.
Configuration
Configuration depends on the linter used.
In eslint, either define the used rules manually, or use one of the configs provided by the plugin.
import { defineConfig } from "eslint/config";
import typegpu from "eslint-plugin-typegpu";
export default defineConfig([
// other configs
typegpu.configs.recommended,
]);eslint-plugin-typegpu provides two configs: all (enabled on all rules) and recommended.
List of supported rules
🚨 Configurations enabled in.
⚠️ Configurations set to warn in.
⭐ Set in the recommended configuration.
| Name | Description | 🚨 | ⚠️ | | :--------------------------------------------------------------------- | :------------------------------------------------------------------------------------------ | :- | :- | | no-integer-division | Disallow division incorporating numbers wrapped in 'u32' and 'i32' | | ⭐ | | no-math | Disallow usage of JavaScript 'Math' methods inside 'use gpu' functions | | ⭐ | | no-uninitialized-variables | Disallow variable declarations without initializers inside 'use gpu' functions | ⭐ | | | no-unwrapped-objects | Disallow unwrapped Plain Old JavaScript Objects inside 'use gpu' functions (except returns) | ⭐ | |
