Skip to content
This repository was archived by the owner on Dec 19, 2024. It is now read-only.

Commit 8554dac

Browse files
committed
Fix linting issues related to postcss-cssnext merge
1 parent c5f9b4a commit 8554dac

File tree

17 files changed

+43
-34
lines changed

17 files changed

+43
-34
lines changed

.eslintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ rules:
3535
indent: [2, 2] # 2 spaces indentation
3636
max-len: [2, 80, 4]
3737
quotes: [2, "double"]
38+
jsx-quotes: [2, "prefer-double"]
3839
semi: [2, "never"]
3940
no-multiple-empty-lines: [2, {"max": 1}]
4041

@@ -65,7 +66,6 @@ rules:
6566
# eslint-plugin-react rules
6667
react/jsx-boolean-value: 2
6768
react/jsx-no-undef: 2
68-
react/jsx-quotes: 2
6969
#react/jsx-sort-prop-types: 2
7070
#react/jsx-sort-props: 2
7171
react/jsx-uses-react: 2

docs/scripts/build.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import path from "path"
22

3-
import {sync as rm} from "rimraf"
3+
import { sync as rm } from "rimraf"
44
import color from "chalk"
55

66
import Metalsmith from "metalsmith"
@@ -30,7 +30,7 @@ const log = nanoLogger("./build")
3030

3131
JSON.stringify(buildConfig, null, 2).split("\n").forEach(l => log(l))
3232

33-
const mdToHtmlReplacement = [/\.md$/, ".html"]
33+
const mdToHtmlReplacement = [ /\.md$/, ".html" ]
3434

3535
// We clean ./dist by hand mainly for prod, in order to be able to build
3636
// assets with webpack before metalsmith build.
@@ -63,7 +63,7 @@ smith
6363
.use(
6464
url([
6565
mdToHtmlReplacement,
66-
[/index\.html?$/, ""],
66+
[ /index\.html?$/, "" ],
6767
])
6868
)
6969
// wrap .html into react `template:`
@@ -87,9 +87,9 @@ smith
8787
rename([
8888
mdToHtmlReplacement,
8989
// no .html at the end of urls
90-
[/\.html$/, "/index.html"],
90+
[ /\.html$/, "/index.html" ],
9191
// ensure we only have index.html, no index/index
92-
[/index\/index\.html$/, "index.html"],
92+
[ /index\/index\.html$/, "index.html" ],
9393
])
9494
)
9595

docs/scripts/webpack.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,19 @@ export default (webpackConfig, log, cb) => {
99

1010
if (stats.hasErrors()) {
1111
stats.compilation.errors.forEach(
12-
item => log(...[color.red("Error:"), ...item.message.split("\n")])
12+
item => log(...[
13+
color.red("Error:"),
14+
...item.message.split("\n"),
15+
])
1316
)
1417
throw new Error("webpack build failed with errors")
1518
}
1619
if (stats.hasWarnings()) {
1720
stats.compilation.warnings.forEach(
18-
item => log(...[color.yellow("Warning:"), ...item.message.split("\n")])
21+
item => log(...[
22+
color.yellow("Warning:"),
23+
...item.message.split("\n"),
24+
])
1925
)
2026
}
2127

docs/src/layouts/Default.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, {Component, PropTypes} from "react"
1+
import React, { Component, PropTypes } from "react"
22
import cx from "classnames"
33

44
import dashify from "../modules/dashify"
@@ -124,7 +124,7 @@ export default class Default extends Component {
124124
"r-Grid-cell": true,
125125
"js-markdownIt-TOCOriginalContainer": true,
126126
})}
127-
dangerouslySetInnerHTML={{__html: file.contents}}
127+
dangerouslySetInnerHTML={{ __html: file.contents }}
128128
/>
129129
<div
130130
className={cx({

docs/src/layouts/Simple.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, {Component, PropTypes} from "react"
1+
import React, { Component, PropTypes } from "react"
22

33
import Html from "../modules/Html"
44
import Head from "../modules/Head"
@@ -52,7 +52,7 @@ export default class Simple extends Component {
5252
>
5353
<div
5454
className={file.className || ""}
55-
dangerouslySetInnerHTML={{__html: file.contents}}
55+
dangerouslySetInnerHTML={{ __html: file.contents }}
5656
/>
5757
</Body>
5858
</Html>

docs/src/modules/Analytics/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, {Component} from "react"
1+
import React, { Component } from "react"
22

33
import isogram from "isogram"
44

docs/src/modules/Body/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, {Component, PropTypes} from "react"
1+
import React, { Component, PropTypes } from "react"
22

33
import Header from "../Header"
44
import Footer from "../Footer"

docs/src/modules/Footer/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, {Component, PropTypes} from "react"
1+
import React, { Component, PropTypes } from "react"
22

33
import SVGIcon from "../SVGIcon"
44
import requireRaw from "../requireRaw"

docs/src/modules/Head/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, {Component, PropTypes} from "react"
1+
import React, { Component, PropTypes } from "react"
22

33
export default class Head extends Component {
44

docs/src/modules/Header/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, {Component, PropTypes} from "react"
1+
import React, { Component, PropTypes } from "react"
22

33
import SVGIcon from "../SVGIcon"
44
import requireRaw from "../requireRaw"

docs/src/modules/Header/link.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, {Component, PropTypes} from "react"
1+
import React, { Component, PropTypes } from "react"
22
import cx from "classnames"
33

44
export default class HeaderLink extends Component {
@@ -30,7 +30,7 @@ export default class HeaderLink extends Component {
3030
className={cx({
3131
...(
3232
this.props.className
33-
? {[this.props.className]: true}
33+
? { [this.props.className]: true }
3434
: {}
3535
),
3636
"cssnext-Header-nav-item": true,

docs/src/modules/Html/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, {Component, PropTypes} from "react"
1+
import React, { Component, PropTypes } from "react"
22

33
export default class Html extends Component {
44

docs/src/modules/SVGIcon/__tests__/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import tape from "tape-catch"
2-
import React, {Component} from "react"
2+
import React, { Component } from "react"
33
import SVGIcon from ".."
44

55
tape("SVGIcon", (test) => {
@@ -70,7 +70,7 @@ tape("SVGIcon", (test) => {
7070

7171
test.equal(
7272
React.renderToStaticMarkup(
73-
<SVGIcon cleanupExceptions={["fill"]} svg={`<svg ${svgPiece}`} />
73+
<SVGIcon cleanupExceptions={[ "fill" ]} svg={`<svg ${svgPiece}`} />
7474
),
7575
`${SVGIconCleanedStart}><g fill="none"><path fill="#ab234f"></path></g>` +
7676
`</svg></span>`,

docs/src/modules/SVGIcon/index.js

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, {Component, PropTypes} from "react"
1+
import React, { Component, PropTypes } from "react"
22
// import styled from "bloody-react-styled"
33
import cx from "classnames"
44

@@ -28,14 +28,9 @@ const cleanups = {
2828
// @styled(styles)
2929
export default class SVGIcon extends Component {
3030

31-
static defaultProps = {
32-
component: "span",
33-
classSuffix: "-svg",
34-
cleanup: [],
35-
cleanupExceptions: [],
36-
}
37-
3831
static propTypes = {
32+
className: PropTypes.string,
33+
classSuffix: PropTypes.string,
3934
component: PropTypes.oneOfType([
4035
PropTypes.string,
4136
PropTypes.func,
@@ -46,10 +41,18 @@ export default class SVGIcon extends Component {
4641
PropTypes.bool,
4742
PropTypes.array,
4843
]),
44+
cleanupExceptions: PropTypes.array,
4945
width: PropTypes.string,
5046
height: PropTypes.string,
5147
}
5248

49+
static defaultProps = {
50+
component: "span",
51+
classSuffix: "-svg",
52+
cleanup: [],
53+
cleanupExceptions: [],
54+
}
55+
5356
static cleanupSvg(svg, cleanup = []) {
5457
return Object.keys(cleanups)
5558
.filter(key => cleanup.includes(key))
@@ -97,7 +100,7 @@ export default class SVGIcon extends Component {
97100
height = width
98101
}
99102

100-
const props = {...this.props}
103+
const props = { ...this.props }
101104
// remove useless props for wrapper
102105
delete props.svg
103106
delete props.fill

docs/src/modules/playground/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import cssnext from "../../../../src/index"
2-
import {version as cssnextVersion} from "../../../../package"
2+
import { version as cssnextVersion } from "../../../../package"
33
import messagesStyles from "../../../../src/option.messages.browser.styles"
44

55
const bullet = "›"

docs/src/modules/requireRaw.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ if (fs && fs.readFileSync) {
1111
requireRaw = (filename) => {
1212
return fs.readFileSync(
1313
path.join(__dirname, "..", "..", filename),
14-
{encoding: "utf8"}
14+
{ encoding: "utf8" }
1515
)
1616
}
1717
}

webpack.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ module.exports = {
4848

4949
plugins: ([
5050
new webpack.DefinePlugin(buildConfig),
51-
new ExtractTextPlugin("[name].css", {disable: !buildConfig.__PROD__}),
51+
new ExtractTextPlugin("[name].css", { disable: !buildConfig.__PROD__ }),
5252
].concat(
5353
buildConfig.__PROD__
5454
? [

0 commit comments

Comments
 (0)