Skip to content

Commit

Permalink
Bug 1811820 - Change prettier config file from json to common js form…
Browse files Browse the repository at this point in the history
…at. r=cmkm,Gijs

Differential Revision: https://phabricator.services.mozilla.com/D167530
  • Loading branch information
Standard8 committed Jan 24, 2023
1 parent 2150dc2 commit e69b88c
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 13 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
# - build directories and other items that we need to ignore

!.eslintrc*.js
!.prettierrc.js

# Always ignore node_modules.
**/node_modules/
Expand Down
6 changes: 0 additions & 6 deletions .prettierrc

This file was deleted.

12 changes: 12 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/* eslint-env node */

module.exports = {
endOfLine: "lf",
printWidth: 80,
tabWidth: 2,
trailingComma: "es5",
};
14 changes: 7 additions & 7 deletions devtools/client/debugger/.prettierrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

const fs = require("fs");
"use strict";

// eslint-disable-next-line mozilla/reject-relative-requires
const topLevelPrettier = require("../../../.prettierrc.js");

module.exports = {
...JSON.parse(fs.readFileSync(__dirname + "/../../../.prettierrc")),
...topLevelPrettier,
overrides: [
{
files: [
"src/**/*.js",
"packages/*/src/**/*.js",
],
files: ["src/**/*.js", "packages/*/src/**/*.js"],
options: {
// The debugger uses Babel 7 and some newer Flow features.
// Unfortunately, Prettier has not yet adopted a version of Babel's
// parser with this fix: https://github.com/babel/babel/pull/9891
// That necessitates us to override to config to explicitly tell
// Prettier that our files contain Flowtype annotations.
"parser": "babel-flow"
parser: "babel-flow",
},
},
],
Expand Down

0 comments on commit e69b88c

Please sign in to comment.