1.0.4 • Published 1 year ago

@chaitanyathakur/eslint-plugin-p5js v1.0.4

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

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 .
1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago