Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get eslint to validate Adobe Extendscript (.jsx) files in VSCode

I'm trying to write extendscript scripts for Adobe After Effects, using VSCode. I'd like to get some linting happening (not too fussed if it's ESLint or any other linter), but I can't convince ESLint to lint my files.

Extendscript is a dialect of the ECMAScript standard and therefore similar to JavaScript and ActionScript. The files have the extension .jsx. There are some extendscript plugins for VSCode, this one provides language support, so that VSCode sees my .jsx files as extendscript files. So I was hoping that this would work in my settings.json:

{
  "eslint.options": {
    "extensions":  [".jsx", ".js"]
  },
  "eslint.validate": [
    "javascript",
    "javascriptreact",
    "extendscript"
  ]
}

If I try the command ESLint.ShowOutputChannel I get the error:

ESLint is not running. By default only JavaScript files are validated. If you want to validate other file types please specify them in the 'eslint.validate' setting.

edit I also tried replacing "extendscript" in line 10 with

{ "language": "extendscript", "autofix": false }

But no luck.

like image 736
stib Avatar asked Oct 23 '25 15:10

stib


2 Answers

This worked for me:

{
  "eslint.options": {
    "extensions":  [".jsx", ".js"]
  },
  "eslint.validate": [
    "javascript",
    "javascriptreact",
    "jsx"
  ]
}

Looking on the github repo for the Extendscript Language, I've found out that the language id is registered as jsx, instead of extendscript.

like image 188
Lourenzo Ferreira Avatar answered Oct 25 '25 04:10

Lourenzo Ferreira


I think your user/workspace settings are OK. Maybe you are missing having installed ESLint?

If you are working on a workspace, you should have installed eslint in your package.json

npm i -D eslint babel-eslint

If you just want VS Code lint always your files, you can install eslint as global package:

npm i -g eslint babel-eslint

After that, you should initialize eslint

eslint --init

See more examples and documentation for eslint cli

like image 37
jherax Avatar answered Oct 25 '25 03:10

jherax



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!