ESLint rules for Adobe Premiere Pro UXP API usage. Helps catch common mistakes at development time that would otherwise only surface as runtime exceptions.
npm install @adobe/eslint-plugin-premierepro --save-devThis plugin provides two tiers of rules:
- Syntactic rules — work in any JavaScript or TypeScript project. They use naming conventions and AST patterns to detect issues.
- Type-checked rules — require typed linting with
@typescript-eslint/parserand atsconfig.json. They use TypeScript's type checker for more accurate detection, eliminating false positives and catching patterns (like wrapper functions) that syntactic rules cannot.
If your project uses TypeScript with typed linting, use recommendedTypeChecked. Otherwise, use recommended.
Syntactic only (works with any JavaScript or TypeScript project):
// eslint.config.js
import premierepro from "@adobe/eslint-plugin-premierepro";
export default [
premierepro.configs.recommended
];Type-checked (requires typed linting):
// eslint.config.js
import premierepro from "@adobe/eslint-plugin-premierepro";
import tseslint from "typescript-eslint";
export default tseslint.config(
...tseslint.configs.recommended,
premierepro.configs.recommendedTypeChecked,
// Needed to enable TypeScript's type checking service, see:
// https://typescript-eslint.io/getting-started/typed-linting
{
languageOptions: {
parserOptions: {
projectService: true
}
},
}
);Or configure individual rules:
// eslint.config.js
import premierepro from "@adobe/eslint-plugin-premierepro";
export default [
{
plugins: { "@adobe/premierepro": premierepro },
rules: {
"@adobe/premierepro/require-action-lock-scope-type-checked": "error",
"@adobe/premierepro/require-execute-transaction-type-checked": "error",
// ...
},
},
];These rules work in any project without type information. They use naming conventions (e.g. create*Action() patterns) to detect issues.
| Rule | Description | Recommended |
|---|---|---|
require-action-lock-scope |
Require create*Action() calls to be within Project.lockedAccess() or Project.executeTransaction() |
error |
require-execute-transaction |
Require addAction() calls to be within Project.executeTransaction() |
error |
no-async-in-locked-access |
Disallow async operations inside lockedAccess() callbacks |
error |
no-async-in-execute-transaction |
Disallow async operations inside executeTransaction() callbacks |
error |
no-action-scope-escape |
Disallow action objects from escaping their lock scope | error |
prefer-locked-access-wrapper |
Recommend wrapping executeTransaction() in lockedAccess() |
warn |
prefer-undo-string |
Suggest providing a descriptive undo string for executeTransaction() |
warn |
These rules require typed linting and use TypeScript's type checker for accurate detection. Each rule replaces its syntactic counterpart.
| Rule | Replaces | Description | Recommended |
|---|---|---|---|
require-action-lock-scope-type-checked |
require-action-lock-scope |
Require calls returning premierepro Action to be within Project.lockedAccess() or Project.executeTransaction() |
error |
require-execute-transaction-type-checked |
require-execute-transaction |
Require CompoundAction.addAction() calls to be within Project.executeTransaction() |
error |
no-async-in-locked-access-type-checked |
no-async-in-locked-access |
Disallow async operations inside Project.lockedAccess() callbacks |
error |
no-async-in-execute-transaction-type-checked |
no-async-in-execute-transaction |
Disallow async operations inside Project.executeTransaction() callbacks |
error |
no-action-scope-escape-type-checked |
no-action-scope-escape |
Disallow premierepro Action objects from escaping their lock scope |
error |
prefer-locked-access-wrapper-type-checked |
prefer-locked-access-wrapper |
Recommend wrapping executeTransaction() in lockedAccess() (type-checked) |
warn |
prefer-undo-string-type-checked |
prefer-undo-string |
Suggest providing a descriptive undo string for Project.executeTransaction() (type-checked) |
warn |
- JavaScript project or no typed linting — use
recommended(syntactic rules). - TypeScript project with typed linting — use
recommendedTypeChecked(type-checked rules). These replace the syntactic rules entirely; you do not need both. - Migrating — you can enable both syntactic and type-checked rules during migration. They will not conflict, though you may see duplicate reports for the same issue.
| Config | Description |
|---|---|
recommended |
Syntactic rules with sensible defaults. Works in any project. |
recommendedTypeChecked |
Type-checked rules with sensible defaults. Requires typed linting. |