ESLint Support
Learn how to use ESLint with UXP plugins for Premiere Pro.
Overview
ESLint checks your source for common problems before you run or ship a plugin. That includes general JavaScript issues (undefined variables, suspicious patterns, and so on) and, when you add shared configurations, team-wide style and quality rules.
For Premiere’s UXP DOM APIs, many mistakes only show up at runtime: for example using actions outside Project.lockedAccess() / Project.executeTransaction(), awaiting work inside those callbacks, or letting action objects escape their lock scope. The @adobe/eslint-plugin-premierepro package adds rules aimed at those patterns so you can catch them in the editor or in CI.
The plugin has two tiers:
- Syntactic rules — pattern-based rules that run without TypeScript’s type checker. They work in plain JavaScript or TypeScript projects.
- Type-checked rules — rules that use typed linting (
typescript-eslint, atsconfig, and types from@adobe/premierepro). They understand the real Premiere types, which reduces false positives and covers patterns (such as indirection through helpers) that syntactic rules cannot see reliably.
Use syntactic configs when you are not using typed ESLint. Use type-checked configs when you already have TypeScript and typescript-eslint set up.
@adobe/eslint-plugin-premierepro
Install the plugin as a dev dependency:
npm install -D @adobe/eslint-plugin-premierepro
# Using yarn
yarn add -D @adobe/eslint-plugin-premierepro
# Using pnpm
pnpm add -D @adobe/eslint-plugin-premierepro
The package declares a peer dependency on @adobe/premierepro aligned with the ESLint plugin version. Install that package in your project (typically as a dev dependency) so versions stay in sync:
npm install -D @adobe/premierepro @adobe/eslint-plugin-premierepro
Prebuilt configs:
premierepro.configs.recommendedpremierepro.configs.recommendedTypeCheckedtypescript-eslint.Type-checked rules replace their syntactic counterparts; you normally enable one tier, not both. During migration you can run both briefly, but you may see duplicate messages for the same issue.
What the Premiere rules cover (summary)
Syntactic rules use naming and AST patterns (such as create*Action() and addAction()). Type-checked rules use TypeScript to detect real Action types and related APIs. Topics include:
- Requiring
create*Action()usage insideProject.lockedAccess()orProject.executeTransaction() - Requiring
addAction()insideProject.executeTransaction() - Disallowing
asyncwork insidelockedAccess()/executeTransaction()callbacks - Disallowing
Actioninstances from escaping their lock scope - Optional style rules (undo strings, wrapping
executeTransaction()inlockedAccess())
For full rule names and descriptions, see the plugin README on GitHub.
Syntactic rules and configuration
Use this path for JavaScript-only plugins, or TypeScript projects where you have not enabled typed ESLint. You only need core ESLint, the shared JavaScript recommendations, and the Premiere ESLint plugin.
Quick setup
-
Install ESLint, the shared JS config, and the Premiere plugin
npm install -D eslint @eslint/js @adobe/eslint-plugin-premierepro @adobe/premierepro -
Add an ESLint flat config (ESLint 9+), e.g.
eslint.config.mjsin the project root:// @ts-check import premierepro from "@adobe/eslint-plugin-premierepro"; import js from "@eslint/js"; import { defineConfig } from "eslint/config"; export default defineConfig( js.configs.recommended, premierepro.configs.recommended );This uses
@eslint/jsrecommendedrules for general JavaScript quality, plus Premiere syntactic rules. There are many other plugins and rules available for ESLint that you can use instead depending on your project's or team's requirements: for example a React-based project might want to include plugins likeeslint-plugin-reactoreslint-plugin-react-hooks. -
Add a lint script to
package.json:{ "scripts": { "lint": "eslint ." } } -
Run ESLint
npm run lint
If your compiled output lives in a folder such as dist/, add an ignores entry (or a separate config object with ignores) so ESLint does not lint generated files.
Pros and cons (syntactic)
Pros: Minimal tooling; works the same for .js and .ts; fast; no tsconfig or type-aware parser required.
Cons: Rules infer Premiere usage from patterns, so some edge cases and refactors may be missed or occasionally noisy compared to type-checked rules.
Type-checked rules and configuration
When your project uses TypeScript and you want ESLint to use the type checker, add typescript-eslint (the unified package: typescript-eslint on npm) alongside eslint and @eslint/js. Typed linting lets recommendedTypeChecked use the same Premiere type definitions your editor uses, so rules align with real APIs.
Quick setup
-
Install dependencies
npm install -D eslint @eslint/js typescript-eslint @adobe/eslint-plugin-premierepro @adobe/premiereprotypescript-eslintpulls in the parser and@typescript-eslint/*tooling needed for type-aware rules. Keep@adobe/premiereproon a version compatible with the ESLint plugin (see peer dependency ranges on the plugin’s npm page). -
Ensure
tsconfig.jsonincludes your plugin sourcesYour TypeScript config should cover the files ESLint will lint (for example
src/**/*). See TypeScript projects for a typicaltsconfig.jsonlayout. -
Add an ESLint flat config that enables
typescript-eslintand type-aware parsing, then layers Premiere type-checked rules:// @ts-check import premierepro from "@adobe/eslint-plugin-premierepro"; import js from "@eslint/js"; import { defineConfig } from "eslint/config"; import tseslint from "typescript-eslint"; export default defineConfig( js.configs.recommended, tseslint.configs.recommended, premierepro.configs.recommendedTypeChecked, { languageOptions: { parserOptions: { projectService: true, }, }, } );The
typescript-eslinttyped linting docs describeprojectService: trueand other options. -
Run ESLint the same way as in the syntactic setup (
npm run lint).
Pros and cons (type-checked)
Pros: Stronger, type-accurate Premiere API checks; fewer pattern-based false positives; better results when code wraps actions in helpers.
Cons: More setup (TypeScript, typescript-eslint, valid tsconfig); type-aware linting is slower than syntax-only runs.
Development workflow
A typical loop:
- Terminal — run
npm run lint(or wire lint into CI) before packaging or opening a PR. - Editor — use an ESLint extension so issues surface while you edit.
- Premiere — reload the plugin from the UXP Developer Tool after fixing issues and rebuilding if you use a compile step.
For TypeScript plugins, combine this page with TypeScript support: types power both IntelliSense and type-checked ESLint rules.