Skip to content

Instantly share code, notes, and snippets.

Avatar

Christopher Chedeau vjeux

View GitHub Profile
View help.md
a(
  SomethingVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLong,
  [
    {
      SomethingVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLong: 1
    }
  ]
);
View rollup.config.js
(541) >> yarn build:dist
Using globally installed version of Yarn
yarn build:dist v0.18.1
$ rollup -c dist/rollup.config.js
⚠️ 'default' is imported from external module 'rollup-plugin-node-builtins' but never used
⚠️ 'default' is imported from external module 'rollup-plugin-node-globals' but never used
⚠️ 'default' is imported from external module 'rollup-plugin-real-babili' but never used
View nucl.diff
../nuclide/pkg/commons-atom/ActiveEditorRegistry.js
../nuclide/pkg/commons-atom/arcanist.js
../nuclide/pkg/commons-atom/AutocompleteCacher.js
Index:
===================================================================
---
+++
@@ -15,7 +15,6 @@
shouldFilter?: (
lastRequest: atom$AutocompleteRequest,
View nucl.diff
../nuclide/pkg/commons-atom/ActiveEditorRegistry.js
../nuclide/pkg/commons-atom/arcanist.js
../nuclide/pkg/commons-atom/AutocompleteCacher.js
Index:
===================================================================
---
+++
@@ -15,7 +15,6 @@
shouldFilter?: (
lastRequest: atom$AutocompleteRequest,
View nucl.diff
find ../nuclide/pkg -name '*.js' | xargs ./bin/prettier.js --parser flow --trailing-comma --bracket-spacing false --single-quote --debug-check
Index:
===================================================================
---
+++
@@ -15,7 +15,6 @@
shouldFilter?: (
lastRequest: atom$AutocompleteRequest,
- currentRequest: atom$AutocompleteRequest,
- ) => /* TODO pass originalResult here if any client requires it*/
View nucl.diff
diff --git a/pkg/commons-atom/AutocompleteCacher.js b/pkg/commons-atom/AutocompleteCacher.js
index 8c64580..c040e56 100644
--- a/pkg/commons-atom/AutocompleteCacher.js
+++ b/pkg/commons-atom/AutocompleteCacher.js
@@ -14,9 +14,8 @@ export type AutocompleteCacherConfig<T> = {|
// verifying that the cursor has only moved by one column since the last request.
shouldFilter?: (
lastRequest: atom$AutocompleteRequest,
- currentRequest: atom$AutocompleteRequest,
- ) => /* TODO pass originalResult here if any client requires it*/
View nucl.diff
diff --git a/pkg/commons-atom/AutocompleteCacher.js b/pkg/commons-atom/AutocompleteCacher.js
index 8c64580..c040e56 100644
--- a/pkg/commons-atom/AutocompleteCacher.js
+++ b/pkg/commons-atom/AutocompleteCacher.js
@@ -14,9 +14,8 @@ export type AutocompleteCacherConfig<T> = {|
// verifying that the cursor has only moved by one column since the last request.
shouldFilter?: (
lastRequest: atom$AutocompleteRequest,
- currentRequest: atom$AutocompleteRequest,
- ) => /* TODO pass originalResult here if any client requires it*/
View gist:dbe30eafa69be53fd4d453ead427fd0e
During the past few weeks, I've been working on <a href="https://github.com/jlongster/prettier">prettier</a>, which is a JavaScript pretty printer. We are approaching the phase where we can actually use it so this is a good time to explain how it works.
We're going to go through an example
<pre lang="javascript">
if (!pretty) { makePretty() }
</pre>
<h3>String -> AST</h3>
View diff.diff
diff --git a/src/doc-utils.js b/src/doc-utils.js
index 4d5149c..e2a9e0e 100644
--- a/src/doc-utils.js
+++ b/src/doc-utils.js
@@ -1,77 +1,83 @@
"use strict";
+
function traverseDoc(doc, onEnter, onExit) {
- if(onEnter) {
- onEnter(doc);
View replaceQuotes.js
if (shouldUseSingleQuote) {
return "'" + raw.slice(1, -1).replace(/\\"/g, '"').replace(/'/g, "\\'") + "'";
} else {
return '"' + raw.slice(1, -1).replace(/\\'/g, "'").replace(/"/g, '\\"') + '"';
}