View rails_erb_syntax_check.rb
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
require 'action_view' | |
require 'ruby-beautify' | |
require 'ripper' | |
require 'tmpdir' | |
require 'fileutils' | |
require 'optparse' | |
def check_syntax(path, options = {}) | |
erb = content(path) | |
code = ruby_code(erb) |
View styled components api resolver.js
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
const { utils } = require('react-docgen'); | |
const { default: resolveHOC } = require('react-docgen/dist/utils/resolveHOC'); | |
const { | |
default: resolveToModule, | |
} = require('react-docgen/dist/utils/resolveToModule'); | |
module.exports = ({ moduleName = 'styled-components' } = {}) => { | |
const isStyledExpression = (tagPath, t) => | |
(t.CallExpression.check(tagPath.node) && | |
tagPath.get('callee').node.name === 'styled') || |
View loop-controls.js
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
Mailbox.prototype.extractContents = function(contacts) { | |
let messages = this.messages; | |
loop: | |
for (let i = 0, n = messages.length; i < n; i++) { | |
messages[i].headers.forEach { |header| | |
if (header.isSpam()) | |
continue loop; // the label is not strictly necessary here | |
let addresses = header.extractAddresses(); | |
addresses.forEach { |addr| |