atom如何将.js文件的默认语法高亮显示更改为language-babel

azi*_*ium 4 javascript atom-editor babeljs

这一切都在标题中..突然原子不再默认language-babel为.js文件,我不知道如何回到以前的行为.

更新 - 当前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
Run Code Online (Sandbox Code Playgroud)

我尝试了一些你的建议的变化,显然我搞砸了,因为原子不能再发射了

Bar*_*ter 8

您可以通过在config.cson文件中添加以下内容来创建自定义文件类型

  core:
    customFileTypes:
      "source.js.jsx": [
        "jsx"
        "js"
      ]
Run Code Online (Sandbox Code Playgroud)

这将对所有.js和.jsx文件使用language-babel

  • 这是我的config.cson文件.https://gist.github.com/frost060/f6e259b0c8dc71886b9d3559b9dc03a3 (2认同)