Skip to content

Commit a010018

Browse files
SaraVieirasapegin
authored andcommitted
Chore: Add eslint-plugin-import (styleguidist#484)
1 parent 5cb1798 commit a010018

File tree

92 files changed

+6616
-6119
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+6616
-6119
lines changed

.eslintrc

Lines changed: 44 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,46 @@
11
{
2-
"parser": "babel-eslint",
3-
"extends": "tamia/react",
4-
"plugins": [
5-
"compat",
6-
"es5"
7-
],
8-
"rules": {
9-
"compat/compat": 2
10-
},
11-
"globals": {
12-
"classes": false,
13-
"shallow": false,
14-
"render": false,
15-
"mount": false
16-
}
2+
"parser": "babel-eslint",
3+
"extends": "tamia/react",
4+
"env": {
5+
"browser": true,
6+
"node": true
7+
},
8+
"plugins": [
9+
"compat",
10+
"es5",
11+
"import"
12+
],
13+
"settings": {
14+
"import/resolver": {
15+
"node": {
16+
"moduleDirectory": ["src", "node_modules"]
17+
}
18+
}
19+
},
20+
"rules": {
21+
"compat/compat": "error",
22+
"import/no-unresolved": ["error", {
23+
"commonjs": true,
24+
"caseSensitive": true
25+
}],
26+
"import/export": "error",
27+
"import/no-named-as-default-member": "error",
28+
"import/no-mutable-exports": "error",
29+
"import/no-amd": "error",
30+
"import/first": ["error", "absolute-first"],
31+
"import/no-duplicates": "error",
32+
"import/extensions": ["error", "always", {
33+
"js": "never"
34+
}],
35+
"import/no-extraneous-dependencies": "error",
36+
"import/newline-after-import": "error",
37+
"import/prefer-default-export": "error",
38+
"import/no-named-default": "error"
39+
},
40+
"globals": {
41+
"classes": false,
42+
"shallow": false,
43+
"render": false,
44+
"mount": false
45+
}
1746
}

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ cache:
1010
env:
1111
# Test everything in Webpack 1 and 2
1212
- export WEBPACK_VERSION="2"
13-
- export WEBPACK_VERSION="1"
13+
# - export WEBPACK_VERSION="1"
1414
before_install:
1515
# Upgrade npm
1616
- if [[ `npm -v` != 5* ]]; then npm install -g npm@latest; fi

bin/styleguidist.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,12 @@ function commandServer() {
108108
} else {
109109
const isHttps = compiler.options.devServer && compiler.options.devServer.https;
110110
logger.info(
111-
'Style guide server started at:\n' + (isHttps ? 'https' : 'http') + '://' + config.serverHost + ':' + config.serverPort
111+
'Style guide server started at:\n' +
112+
(isHttps ? 'https' : 'http') +
113+
'://' +
114+
config.serverHost +
115+
':' +
116+
config.serverPort
112117
);
113118
}
114119
});

examples/basic/package-lock.json

Lines changed: 118 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/basic/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
"dependencies": {
2020
"dog-names": "^1.0.2",
2121
"loaders": "^1.1.2",
22+
"lodash": "^4.17.4",
23+
"prop-types": "^15.5.10",
2224
"react": "^15.4.2",
2325
"react-dom": "^15.4.2",
2426
"react-modal": "^1.6.5",

examples/basic/src/components/Button/Button.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@ export default function Button({ color, size, onClick, children }) {
1212
fontSize: Button.sizes[size],
1313
};
1414

15-
return <button className="button" style={styles} onClick={onClick}>{children}</button>;
15+
return (
16+
<button className="button" style={styles} onClick={onClick}>
17+
{children}
18+
</button>
19+
);
1620
}
1721
Button.propTypes = {
1822
/** Button label */

examples/basic/src/components/CounterButton/CounterButton.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ export default class CounterButton extends Component {
3636

3737
render() {
3838
return (
39-
<button className="button" onClick={this.increment.bind(this)}>{this.state.value}</button>
39+
<button className="button" onClick={this.increment.bind(this)}>
40+
{this.state.value}
41+
</button>
4042
);
4143
}
4244
}

examples/basic/src/components/Modal/Modal.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ export default class Modal extends Component {
1818
zIndex: 999,
1919
},
2020
};
21-
return <ReactModal contentLabel="Modal" isOpen={isOpen} style={style}>{children}</ReactModal>;
21+
return (
22+
<ReactModal contentLabel="Modal" isOpen={isOpen} style={style}>
23+
{children}
24+
</ReactModal>
25+
);
2226
}
2327
}

examples/basic/src/components/PushButton/PushButton.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@ export default function PushButton({ color, size, children }) {
1212
fontSize: PushButton.sizes[size],
1313
};
1414

15-
return <button className="push-button" style={styles}>{children}</button>;
15+
return (
16+
<button className="push-button" style={styles}>
17+
{children}
18+
</button>
19+
);
1620
}
1721
PushButton.propTypes = {
1822
/**

examples/basic/src/components/WrappedButton/WrappedButton.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@ const WrappedButton = ({ color, size, children }) => {
1414
fontSize: WrappedButton.sizes[size],
1515
};
1616

17-
return <button className="wrapped-button" style={styles}>{children}</button>;
17+
return (
18+
<button className="wrapped-button" style={styles}>
19+
{children}
20+
</button>
21+
);
1822
};
1923
WrappedButton.propTypes = {
2024
/**

examples/basic/styleguide.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
const loaders = require('loaders');
2+
23
module.exports = {
34
components: 'src/components/**/[A-Z]*.js',
45
defaultExample: true,

examples/cra/package-lock.json

Lines changed: 118 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)