Skip to content

Commit 4a6dd14

Browse files
committed
merge with react-starter-kit
1 parent 6f9b5b1 commit 4a6dd14

Some content is hidden

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

45 files changed

+13398
-3089
lines changed

.babelrc.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/**
2+
* React Starter Kit (https://www.reactstarterkit.com/)
3+
*
4+
* Copyright © 2014-present Kriasoft, LLC. All rights reserved.
5+
*
6+
* This source code is licensed under the MIT license found in the
7+
* LICENSE.txt file in the root directory of this source tree.
8+
*/
9+
10+
// Babel configuration
11+
// https://babeljs.io/docs/usage/api/
12+
module.exports = {
13+
presets: [
14+
[
15+
'@babel/preset-env',
16+
{
17+
targets: {
18+
node: 'current',
19+
},
20+
},
21+
],
22+
'@babel/preset-stage-2',
23+
'@babel/preset-flow',
24+
'@babel/preset-react',
25+
],
26+
ignore: ['node_modules', 'build'],
27+
};

.eslintrc.js

Lines changed: 36 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -32,58 +32,60 @@ module.exports = {
3232
},
3333

3434
rules: {
35-
// `js` and `jsx` are common extensions
36-
// `mjs` is for `universal-router` only, for now
37-
'import/extensions': [
38-
'error',
39-
'always',
40-
{
41-
js: 'never',
42-
jsx: 'never',
43-
mjs: 'never',
44-
},
45-
],
46-
47-
// Not supporting nested package.json yet
48-
// https://github.com/benmosher/eslint-plugin-import/issues/458
49-
'import/no-extraneous-dependencies': 'off',
35+
// Forbid the use of extraneous packages
36+
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-extraneous-dependencies.md
37+
'import/no-extraneous-dependencies': ['error', { packageDir: '.' }],
5038

5139
// Recommend not to leave any console.log in your code
5240
// Use console.error, console.warn and console.info instead
41+
// https://eslint.org/docs/rules/no-console
5342
'no-console': [
5443
'error',
5544
{
5645
allow: ['warn', 'error', 'info'],
5746
},
5847
],
5948

60-
// a11y removed rule, ignore them
61-
'jsx-a11y/href-no-hash': 'off',
49+
// Prefer destructuring from arrays and objects
50+
// http://eslint.org/docs/rules/prefer-destructuring
51+
'prefer-destructuring': [
52+
'error',
53+
{
54+
VariableDeclarator: {
55+
array: false,
56+
object: true,
57+
},
58+
AssignmentExpression: {
59+
array: false,
60+
object: false,
61+
},
62+
},
63+
{
64+
enforceForRenamedProperties: false,
65+
},
66+
],
6267

63-
// https://github.com/evcohen/eslint-plugin-jsx-a11y/issues/308#issuecomment-322954274
64-
'jsx-a11y/label-has-for': 'warn',
68+
// Ensure <a> tags are valid
69+
// https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/anchor-is-valid.md
70+
'jsx-a11y/anchor-is-valid': [
71+
'error',
72+
{
73+
components: ['Link'],
74+
specialLink: ['to'],
75+
aspects: ['noHref', 'invalidHref', 'preferButton'],
76+
},
77+
],
6578

66-
// Allow js files to use jsx syntax, too
79+
// Allow .js files to use JSX syntax
80+
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-filename-extension.md
6781
'react/jsx-filename-extension': ['error', { extensions: ['.js', '.jsx'] }],
6882

69-
// Automatically convert pure class to function by
70-
// babel-plugin-transform-react-pure-class-to-function
71-
// https://github.com/kriasoft/react-starter-kit/pull/961
83+
// Functional and class components are equivalent from React’s point of view
84+
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/prefer-stateless-function.md
7285
'react/prefer-stateless-function': 'off',
7386

74-
'react/jsx-no-bind': 'off',
75-
'react/forbid-prop-types': 'off',
76-
7787
// ESLint plugin for prettier formatting
7888
// https://github.com/prettier/eslint-plugin-prettier
79-
'prettier/prettier': [
80-
'error',
81-
{
82-
// https://github.com/prettier/prettier#options
83-
singleQuote: true,
84-
trailingComma: 'all',
85-
},
86-
],
8789
},
8890

8991
settings: {

.gitattributes

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,16 @@
1010
*.html text eol=lf
1111
*.css text eol=lf
1212
*.less text eol=lf
13+
*.styl text eol=lf
1314
*.scss text eol=lf
15+
*.sass text eol=lf
1416
*.sss text eol=lf
1517
*.js text eol=lf
18+
*.jsx text eol=lf
1619
*.json text eol=lf
1720
*.md text eol=lf
21+
*.mjs text eol=lf
1822
*.sh text eol=lf
23+
*.svg text eol=lf
1924
*.txt text eol=lf
2025
*.xml text eol=lf

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ database.sqlite
1111

1212
# Test coverage
1313
coverage
14-
.nyc_output
1514

1615
# Logs
1716
npm-debug.log*

.nycrc

Lines changed: 0 additions & 14 deletions
This file was deleted.

.prettierrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"singleQuote": true,
3+
"trailingComma": "all",
4+
"printWidth": 80
5+
}

.stylelintrc.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,12 @@ module.exports = {
5757

5858
// https://github.com/hudochenkov/stylelint-order/blob/master/rules/properties-order/README.md
5959
'order/properties-order': [],
60+
/* eslint-disable */
61+
'at-rule-no-unknown': [,
62+
{
63+
ignoreAtRules: ['function', 'if', 'each', 'include', 'mixin'],
64+
},
65+
],
66+
/* eslint-enable */
6067
},
6168
};

.travis.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
language: node_js
22
node_js:
3-
- '8'
4-
- '7'
3+
- 'stable'
54
- '6'
65
env:
76
- CXX=g++-4.8

Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:7.9.0-alpine
1+
FROM node:8.6.0-alpine
22

33
# Set a working directory
44
WORKDIR /usr/src/app
@@ -12,4 +12,7 @@ RUN yarn install --production --no-progress
1212
# Copy application files
1313
COPY ./build .
1414

15+
# Run the container under "node" user by default
16+
USER node
17+
1518
CMD [ "node", "server.js" ]

jest/fileTransformer.js

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)