@chaitanyathakur/eslint-plugin-p5js
v1.0.4
Published
ESLint plugin that defines p5.js globals
Downloads
3
Maintainers
Readme
eslint-plugin-p5js
ESLint plugin that defines p5.js globals.
Installation
First, you need to install ESLint:
npm install eslint --save-dev
Next, install @chaitanyathakur/eslint-plugin-p5js
:
npm install @chaitanyathakur/eslint-plugin-p5js --save-dev`
Usage
Create an eslint.config.js
file in your project root. Add the following:
import globals from "globals";
import pluginJs from "@eslint/js";
import { p5globals, implicit } from "@chaitanyathakur/eslint-plugin-p5js";
export default [
{
files: ["**/*.js"],
languageOptions: {
globals: {
...globals.browser,
...globals.node,
...p5globals,
},
sourceType: "script",
},
rules: {
"no-unused-vars": ["warn", { varsIgnorePattern: implicit }],
},
},
pluginJs.configs.recommended,
];
To lint your p5.js files, run the following command:
npx eslint your-file.js
Or lint your entire project:
npx eslint .