prettier-eslint |
eslint-plugin-prettier |
eslint-config-prettier |
|
---|---|---|---|
What it is | A JavaScript module exporting a single function. | An ESLint plugin. | An ESLint configuration. |
What it does | Runs the code (string) through prettier then eslint --fix . The output is also a string. |
Plugins usually contain implementations for additional rules that ESLint will check for. This plugin uses Prettier under the hood and will raise ESLint errors when your code differs from Prettier's expected output. | This config turns off formatting-related rules that might conflict with Prettier, allowing you to use Prettier with other ESLint configs like eslint-config-airbnb . |
How to use it | Either calling the function in your code or via [prettier-eslint-cli ](https://github.co |
This file contains hidden or 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
// Server Side Rendering based on routes matched by React-router. | |
app.use((req, res) => { | |
match({ | |
routes, | |
location: req.url | |
}, (err, redirectLocation, renderProps) => { | |
if (err) { | |
return res.status(500).end('Internal server error'); | |
} |
This file contains hidden or 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
<template> | |
<require from="./expression"></require> | |
<button class="button-outline button-small" | |
repeat.for="example of examples" | |
click.delegate="expressionString = example.expression"> | |
${example.name} | |
</button> | |
<label class="expression-input"> |
This file contains hidden or 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
<template> | |
<require from="./expression"></require> | |
<button class="button-outline button-small" | |
repeat.for="example of examples" | |
click.delegate="expressionString = example.expression"> | |
${example.name} | |
</button> | |
<label class="expression-input"> |
This file contains hidden or 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
<template> | |
<require from="./modal"></require> | |
<modal> | |
<div slot="modalHeader">This is user provided header content.</div> | |
</modal> | |
</template> |
This file contains hidden or 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
// We’re passing the following variables to the macro: | |
// - The image object | |
// - Alt text | |
// - The transform | |
// - The declared width and height. | |
// This is what will be output in the tag. You may want it to be different than the actual image size. URL, if you want to // link the image Class You can easily add you own items to the macro, like title, onClick, whatever you like. | |
{% macro sizedImage(img, alt, transform, declaredWidth, declaredHeight, link, class) %} |
This file contains hidden or 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
var BatchStream = require('batch-stream2') | |
var gulp = require('gulp') | |
var coffee = require('gulp-coffee') | |
var uglify = require('gulp-uglify') | |
var cssmin = require('gulp-minify-css') | |
var bower = require('gulp-bower-files') | |
var stylus = require('gulp-stylus') | |
var livereload = require('gulp-livereload') | |
var include = require('gulp-include') | |
var concat = require('gulp-concat') |
This file contains hidden or 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
async function run () { | |
try { | |
const response = await fetch('/api/products') | |
const data = await response.json() | |
updateView(data) | |
} catch (err) { | |
console.log('Update failed', err) | |
} | |
} |
This file contains hidden or 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
.embed-container { | |
position: relative; | |
padding-bottom: 56.25%; | |
height: 0; | |
overflow: hidden; | |
max-width: 100%; | |
height: auto; | |
} | |
.embed-container iframe, |
This file contains hidden or 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
// server/app.js | |
const express = require('express'); | |
const morgan = require('morgan'); | |
const path = require('path'); | |
const app = express(); | |
// Setup logger | |
app.use(morgan(':remote-addr - :remote-user [:date[clf]] ":method :url HTTP/:http-version" :status :res[content-length] :response-time ms')); |