forked from desktop/desktop
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update prettier and format SCSS files
Co-Authored-By: Jed Fox <[email protected]>
- Loading branch information
Showing
7 changed files
with
76 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,16 @@ | ||
out/ | ||
dist/ | ||
node_modules/ | ||
npm-debug.log | ||
yarn-error.log | ||
app/node_modules/ | ||
.DS_Store | ||
.awcache | ||
.idea/ | ||
.eslintcache | ||
|
||
app/static/common | ||
app/test/fixtures | ||
gemoji | ||
*.json | ||
*.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
singleQuote: true | ||
trailingComma: es5 | ||
semi: false | ||
proseWrap: always |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#!/usr/bin/env ts-node | ||
|
||
import * as Path from 'path' | ||
import chalk from 'chalk' | ||
import { spawnSync } from 'child_process' | ||
|
||
const shouldFix = process.argv.indexOf('--fix') > -1 | ||
|
||
const root = Path.dirname(__dirname) | ||
|
||
const prettier = process.platform === 'win32' ? 'prettier.cmd' : 'prettier' | ||
const prettierPath = Path.join(root, 'node_modules', '.bin', prettier) | ||
|
||
const args = ['**/*.scss', '--list-different'] | ||
|
||
if (shouldFix) { | ||
args.push('--write') | ||
} | ||
|
||
const result = spawnSync(prettierPath, args, { | ||
cwd: root, | ||
}) | ||
|
||
if (!shouldFix && result.status > 0) { | ||
process.exitCode = result.status | ||
|
||
const fileList = result.stdout.toString().trim() | ||
|
||
if (fileList.length > 0) { | ||
console.log('These files are not formatted correctly:\n') | ||
|
||
console.log(result.stdout.toString()) | ||
|
||
console.error( | ||
chalk`{bold.green → To fix these errors, run {underline yarn lint:prettier --fix}}` | ||
) | ||
} else { | ||
console.log('Something went wrong with invoking prettier:') | ||
console.log(result.stderr.toString()) | ||
} | ||
} else if (result.status < 0) { | ||
process.exitCode = result.status | ||
|
||
console.log('prettier returned an unexpected exit code') | ||
console.log(`stdout: '${result.stdout.toString()}'`) | ||
console.log(`stderr: '${result.stderr.toString()}'`) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5310,9 +5310,9 @@ preserve@^0.2.0: | |
version "0.2.0" | ||
resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" | ||
|
||
[email protected].0: | ||
version "1.10.0" | ||
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.10.0.tgz#0b89c9b0d55d0862d9c977e4b459696bdea564fb" | ||
[email protected].2: | ||
version "1.10.2" | ||
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.10.2.tgz#1af8356d1842276a99a5b5529c82dd9e9ad3cc93" | ||
|
||
pretty-bytes@^1.0.2: | ||
version "1.0.4" | ||
|