Skip to content

Commit 5065ff8

Browse files
committed
lint: use standard style in readme
1 parent 14147af commit 5065ff8

4 files changed

Lines changed: 12 additions & 7 deletions

File tree

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ cache:
1717
before_install:
1818
# Setup Node.js version-specific dependencies
1919
- "test $TRAVIS_NODE_VERSION != '0.8' || npm rm --save-dev istanbul"
20-
- "test $(echo $TRAVIS_NODE_VERSION | cut -d. -f1) -ge 4 || npm rm --save-dev eslint eslint-config-standard eslint-plugin-promise eslint-plugin-standard"
20+
- "test $(echo $TRAVIS_NODE_VERSION | cut -d. -f1) -ge 4 || npm rm --save-dev eslint eslint-config-standard eslint-plugin-markdown eslint-plugin-promise eslint-plugin-standard"
2121

2222
# Update Node.js modules
2323
- "test ! -d node_modules || npm prune"

README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ $ npm install serve-static
1919

2020
## API
2121

22+
<!-- eslint-disable no-unused-vars -->
23+
2224
```js
2325
var serveStatic = require('serve-static')
2426
```
@@ -158,7 +160,7 @@ var serve = serveStatic('public/ftp', {
158160
})
159161

160162
// Set header to force download
161-
function setHeaders(res, path) {
163+
function setHeaders (res, path) {
162164
res.setHeader('Content-Disposition', contentDisposition(path))
163165
}
164166

@@ -195,12 +197,13 @@ a fallback.
195197

196198
```js
197199
var express = require('express')
200+
var path = require('path')
198201
var serveStatic = require('serve-static')
199202

200203
var app = express()
201204

202-
app.use(serveStatic(__dirname + '/public-optimized'))
203-
app.use(serveStatic(__dirname + '/public'))
205+
app.use(serveStatic(path.join(__dirname, 'public-optimized')))
206+
app.use(serveStatic(path.join(__dirname, 'public')))
204207
app.listen(3000)
205208
```
206209

@@ -212,11 +215,12 @@ is for 1 day.
212215

213216
```js
214217
var express = require('express')
218+
var path = require('path')
215219
var serveStatic = require('serve-static')
216220

217221
var app = express()
218222

219-
app.use(serveStatic(__dirname + '/public', {
223+
app.use(serveStatic(path.join(__dirname, 'public'), {
220224
maxAge: '1d',
221225
setHeaders: setCustomCacheControl
222226
}))

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ cache:
1515
install:
1616
- ps: Install-Product node $env:nodejs_version
1717
- if "%nodejs_version%" equ "0.8" npm rm --save-dev istanbul
18-
- npm rm --save-dev eslint eslint-config-standard eslint-plugin-promise eslint-plugin-standard
18+
- npm rm --save-dev eslint eslint-config-standard eslint-plugin-markdown eslint-plugin-promise eslint-plugin-standard
1919
- if exist node_modules npm prune
2020
- if exist node_modules npm rebuild
2121
- npm install

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"devDependencies": {
1515
"eslint": "3.16.1",
1616
"eslint-config-standard": "6.2.1",
17+
"eslint-plugin-markdown": "1.0.0-beta.3",
1718
"eslint-plugin-promise": "3.4.0",
1819
"eslint-plugin-standard": "2.0.1",
1920
"istanbul": "0.4.5",
@@ -29,7 +30,7 @@
2930
"node": ">= 0.8.0"
3031
},
3132
"scripts": {
32-
"lint": "eslint .",
33+
"lint": "eslint --plugin markdown --ext js,md .",
3334
"test": "mocha --reporter spec --bail --check-leaks test/",
3435
"test-ci": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/",
3536
"test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/"

0 commit comments

Comments
 (0)