npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@figma/eslint-plugin-figma-plugins

v0.15.0

Published

typescript-eslint rules for Figma plugin development

Downloads

24,878

Readme

eslint-plugin-figma-plugins

This repository defines typescript-eslint rules for Figma plugin development.

This tool helps you stay up to date with best practices and deprecations in the Figma Plugin API. You can use it to help identify, and in many cases automatically fix, issues in your plugin code. Like any ESLint plugin, it integrates with IDEs like VSCode to provide inline warnings and quick-fix functionality.

A quick look

An animation of VSCode quick fixes enabled by this plugin

Installation

Dependencies

This linter requires TypeScript, ESLint, typescript-eslint, and the Figma Plugin API type definitions. To install all of these, run:

npm install -D typescript eslint @typescript-eslint/parser @typescript-eslint/eslint-plugin @figma/plugin-typings

Install the ESLint plugin package

npm install -D @figma/eslint-plugin-figma-plugins

Configure eslint

Configure typescript-eslint as normal using these instructions.

Next, update your ESLint config's extends array to include the plugin:@figma/figma-plugins/recommended ruleset. We also recommend the following rulesets:

  • eslint:recommended,
  • plugin:@typescript-eslint/recommended

To work with TypeScript code, ESLint also requires the following parser settings:

{
  ...
  parser: '@typescript-eslint/parser',
  parserOptions: {
    project: './tsconfig.json',
  },
  ...
}

Here's a full example of .eslintrc.js:

/* eslint-env node */
module.exports = {
  extends: [
    'eslint:recommended',
    'plugin:@typescript-eslint/recommended',
    'plugin:@figma/figma-plugins/recommended',
  ],
  parser: '@typescript-eslint/parser',
  parserOptions: {
    project: './tsconfig.json',
  },
  root: true
}

Restart the ESLint server

If you've run npm install and updated to a newer version of this package, remember to restart your IDE. In VSCode, you can restart the ESLint server independently by opening the command palette and choosing "Restart ESLint Server".

Usage

Linting and autofixing

You can lint your project using these rules by running

npx eslint ./path/to/source

Some rules provide autofixes, which you can run using --fix.

npx eslint --fix ./path/to/source

Autofixes are also available via some IDEs.

VSCode

To use ESLint with VSCode, see the ESLint VSCode extension. This extension will show rule violations inline, as well as provide opportunities to run autofixes directly in the IDE.

Rules

💼 Configurations enabled in.
⚠️ Configurations set to warn in.
👍 Set in the recommended configuration.
🔦 Set in the recommended-problems-only configuration.
🔧 Automatically fixable by the --fix CLI option.

| Name | Description | 💼 | ⚠️ | 🔧 | | :------------------------------------------------------------------------------------------------- | :--------------------------------------------------- | :---- | :- | :- | | await-requires-async | Require functions that contain await to be async | 👍 🔦 | | 🔧 | | ban-deprecated-id-params | Ban use of deprecated string ID parameters | 👍 🔦 | | 🔧 | | ban-deprecated-sync-methods | Ban use of deprecated synchronous methods | 👍 🔦 | | 🔧 | | ban-deprecated-sync-prop-getters | Ban use of deprecated synchronous property getters | 👍 🔦 | | 🔧 | | ban-deprecated-sync-prop-setters | Ban use of deprecated synchronous property getters | 👍 🔦 | | 🔧 | | dynamic-page-documentchange-event-advice | Advice on using the documentchange event | | 👍 | | | dynamic-page-find-method-advice | Advice on using the find*() family of methods | | 👍 | |

Contributing

Please see CONTRIBUTING.md