Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

atom how to change default syntax highlighting for .js files to language-babel

It's all in the title.. suddenly atom no longer defaults to language-babel for .js files and I'm not sure how to get back to the previous behaviour.

update - current config.cson:

"*":
  core:
    telemetryConsent: "no"
  editor:
    fontFamily: "Operator Mono Lig"
  "exception-reporting":
    userId: "a8f4cc72-fe9c-4093-b562-fcb344219d50"
  "language-dotenv":
    dotenvFileNames: [
      ".env"
      ".env.schema"
    ]
  "linter-eslint": {}
  "linter-ui-default": {}
  "prettier-atom":
    formatOnSaveOptions:
      enabled: true
      isDisabledIfNotInPackageJson: true
    prettierOptions:
      bracketSpacing: false
      semi: false
    useEslint: true
  "tree-view":
    hideVcsIgnoredFiles: true
  welcome:
    showOnStartup: false
".languagebabel.ttlextension":
  editor:
    softWrap: true

I tried a few variations of your suggestion and clearly I messed it up because atom could no longer launch

like image 548
azium Avatar asked Nov 04 '18 20:11

azium


1 Answers

You can create a custom file type by adding following in your config.cson file

  core:
    customFileTypes:
      "source.js.jsx": [
        "jsx"
        "js"
      ]

This will use language-babel for all the .js and .jsx files

like image 181
Barometer Avatar answered Nov 05 '22 04:11

Barometer