DevTools/CodingStandards: Difference between revisions

Jump to navigation Jump to search
Fixing chdir breaks more things than it fixes
(Fix chdir error)
(Fixing chdir breaks more things than it fixes)
Line 29: Line 29:
* install [http://www.sublimelinter.com/en/latest/installation.html SublimeLinter 3], this is a framework for linters that supports, among others, ESLint, (installing SublimeLinter via [https://packagecontrol.io/installation Package Control] is the easiest way),
* install [http://www.sublimelinter.com/en/latest/installation.html SublimeLinter 3], this is a framework for linters that supports, among others, ESLint, (installing SublimeLinter via [https://packagecontrol.io/installation Package Control] is the easiest way),
* with SublimeLinter installed, you can now [https://github.com/roadhump/SublimeLinter-eslint#linter-installation install the specific ESLint plugin] (the installation instruction provide details about how to install node, npm, eslint which are required).
* with SublimeLinter installed, you can now [https://github.com/roadhump/SublimeLinter-eslint#linter-installation install the specific ESLint plugin] (the installation instruction provide details about how to install node, npm, eslint which are required).
If you regularly have the sublime text console open you may notice this error:
<code>
  chdir not set or invalid
</code>
To resolve this issue:
* Right-click in the content area.
* 'SublimeLinter' -> 'Open User Settings'
* Set chdir in the eslint linter settings to "${project}":
<code>
  {
    "user": {
      "linters": {
        "eslint": {
          "@disable": false,
          "args": [],
          "excludes": [],
          "chdir": "${project}"
        }
      }
    }
  }
</code>


Once done, open the mozilla project in SublimeText and open any JS file in either <code>/browser/devtools</code> or <code>/toolkit/devtools</code> (the 2 main directories for DevTools code). You can then trigger the linter via the contextual menu (right click on the file itself) or with a keyboard shortcut (ctrl+option+L on Mac).
Once done, open the mozilla project in SublimeText and open any JS file in either <code>/browser/devtools</code> or <code>/toolkit/devtools</code> (the 2 main directories for DevTools code). You can then trigger the linter via the contextual menu (right click on the file itself) or with a keyboard shortcut (ctrl+option+L on Mac).
Confirmed users
64

edits

Navigation menu