Skip to content

Commit b483933

Browse files
author
Caleb Cassel
committedJan 29, 2019
Update React rules and Docker build
1 parent be347df commit b483933

File tree

21 files changed

+1560
-827
lines changed

21 files changed

+1560
-827
lines changed
 

‎.dockerignore

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
node_modules
2-
packages/eslint-config-hudl/node_modules
1+
**

‎Dockerfile

+3-9
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:10.12.0
1+
FROM node:10.15.0
22

33
ARG HudlCiToolsTagName
44
ARG npmRegistryUrl
@@ -8,18 +8,12 @@ ARG npmPackageDir
88
ARG teamCityNpmPassword
99
ARG teamCityNpmAuthToken
1010

11-
RUN npm i -g hudl-ci-tools@${HudlCiToolsTagName} --registry=${npmRegistryUrl}
12-
13-
# install yarn 1.11.1
14-
RUN curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.11.1
15-
16-
11+
# The 10.15.0 image includes Yarn 1.13.0
1712
RUN yarn config set registry "${npmRegistryUrl}"
13+
RUN yarn global add hudl-ci-tools@${HudlCiToolsTagName}
1814

1915
ENTRYPOINT [ "/bin/bash", "/app/ci/run.sh" ]
2016

21-
ENV HudlCiToolsTagName="${HudlCiToolsTagName}"
22-
ENV npmRegistryUrl="${npmRegistryUrl}"
2317
ENV teamcityBuildBranch="${teamcityBuildBranch}"
2418
ENV buildNumber="${buildNumber}"
2519
ENV teamCityNpmPassword="${teamCityNpmPassword}"
File renamed without changes.

‎ci/local-build.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ export teamcityBuildBranch="branch-name"
99
export buildNumber="1234"
1010
export teamCityNpmPassword="hello"
1111
export teamCityNpmAuthToken="world"
12-
export service="eslint-config-hudl"
12+
export service="javascript"
1313

14-
./teamcity-build.sh
14+
./teamcity-build.sh

‎ci/run.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env bash
2-
set -ex
2+
set -exuo pipefail
33

44
cp -r /app /app-copy
55
cd /app-copy/packages/eslint-config-hudl

‎ci/teamcity-build.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ set -ex
33

44
cd "$( dirname "${BASH_SOURCE[0]}" )"
55

6-
docker-compose -f docker-compose.teamcity.yml build $service-build
7-
docker-compose -f docker-compose.teamcity.yml run --rm $service-build
6+
docker-compose -f docker-compose.yml build $service-build
7+
docker-compose -f docker-compose.yml run --rm $service-build

‎es5/README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@
194194
var fullName = 'Bob ' + this.lastName;
195195
```
196196

197-
- Strings longer than 80 characters should be written across multiple lines using string concatenation.
197+
- Strings longer than 100 characters should be written across multiple lines using string concatenation.
198198
- Note: If overused, long strings with concatenation could impact performance. [jsPerf](http://jsperf.com/ya-string-concat) & [Discussion](https://github.com/airbnb/javascript/issues/40).
199199

200200
```javascript
@@ -1671,6 +1671,7 @@
16711671
- **SeekingAlpha**: [seekingalpha/javascript-style-guide](https://github.com/seekingalpha/javascript-style-guide)
16721672
- **Shutterfly**: [shutterfly/javascript](https://github.com/shutterfly/javascript)
16731673
- **StudentSphere**: [studentsphere/javascript](https://github.com/studentsphere/javascript)
1674+
- **Super**: [SuperJobs/javascript](https://github.com/SuperJobs/javascript)
16741675
- **Target**: [target/javascript](https://github.com/target/javascript)
16751676
- **TheLadders**: [TheLadders/javascript](https://github.com/TheLadders/javascript)
16761677
- **T4R Technology**: [T4R-Technology/javascript](https://github.com/T4R-Technology/javascript)

‎linters/.jshintrc

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434
// Prohibit use of a variable before it is defined.
3535
"latedef": true,
3636

37-
// Enforce line length to 120 characters
38-
"maxlen": 120,
37+
// Enforce line length to 100 characters
38+
"maxlen": 100,
3939

4040
// Require capitalized names for constructor functions.
4141
"newcap": true,

‎linters/SublimeLinter/SublimeLinter.sublime-settings

+3-3
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@
6363

6464
// Warn when variables are defined but never used.
6565
"unused": true,
66-
67-
// Enforce line length to 120 characters
68-
"maxlen": 120,
66+
67+
// Enforce line length to 80 characters
68+
"maxlen": 80,
6969

7070
// Enforce placing 'use strict' at the top function scope
7171
"strict": true

‎package.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{
2-
"name": "airbnb-style",
2+
"name": "hudl-javascript",
33
"version": "2.0.0",
44
"description": "A mostly reasonable approach to JavaScript.",
55
"scripts": {
66
"test": "echo \"Error: no test specified\" && exit 1",
7-
"publish-all": "npm publish && cd ./packages/eslint-config-airbnb && npm publish"
7+
"publish-all": "npm publish && cd ./packages/eslint-config-hudl && npm publish"
88
},
99
"repository": {
1010
"type": "git",
11-
"url": "https://github.com/airbnb/javascript.git"
11+
"url": "https://github.com/hudl/javascript.git"
1212
},
1313
"keywords": [
1414
"style guide",
@@ -22,7 +22,7 @@
2222
"author": "Harrison Shoff <hi@hshoff.com> (https://twitter.com/hshoff)",
2323
"license": "MIT",
2424
"bugs": {
25-
"url": "https://github.com/airbnb/javascript/issues"
25+
"url": "https://github.com/hudl/javascript/issues"
2626
},
27-
"homepage": "https://github.com/airbnb/javascript"
27+
"homepage": "https://github.com/hudl/javascript"
2828
}

‎packages/eslint-config-hudl/CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
### 7.0.0
2+
3+
* [breaking] Require ESLint 4 or 5
4+
* [minor] Add and update several React rules
5+
* [minor] Build with Docker
6+
17
### 6.0.1 / 2018-02-23
28

39
* [bug] Remove react/wrap-multilines

‎packages/eslint-config-hudl/docs/comparisons/with-airbnb-master.md

+202-140
Large diffs are not rendered by default.

‎packages/eslint-config-hudl/legacy.js

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ module.exports = {
1414
mocha: false,
1515
jasmine: false,
1616
},
17-
ecmaFeatures: {},
1817
globals: {},
1918
rules: {},
2019
};

‎packages/eslint-config-hudl/package.json

+10-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "eslint-config-hudl",
3-
"version": "6.0.1",
3+
"version": "7.0.0",
44
"description": "Hudl's ESLint config, following our styleguide",
55
"main": "index.js",
66
"scripts": {
@@ -47,7 +47,10 @@
4747
},
4848
"tasksConfig": {
4949
"test": {
50-
"src": ["lib/**/*.js", "!**/__specs__/**/*.js"],
50+
"src": [
51+
"lib/**/*.js",
52+
"!**/__specs__/**/*.js"
53+
],
5154
"tests": "**/*-specs.js",
5255
"setup": "./test/setup",
5356
"coverageThresholds": {
@@ -65,14 +68,14 @@
6568
"deep-diff": "^0.3.3",
6669
"deep-property": "^1.1.0",
6770
"dir-compare": "0.0.2",
68-
"eslint": "^3.15.0",
71+
"eslint": "^4.19.1 || ^5.6.1",
6972
"eslint-plugin-import": "^2.2.0",
70-
"eslint-plugin-jsx-a11y": "^4.0.0",
71-
"eslint-plugin-react": "^6.9.0",
73+
"eslint-plugin-jsx-a11y": "^6.1.1",
74+
"eslint-plugin-react": "^7.11.1",
7275
"eslint-teamcity": "^1.0.0",
7376
"fs-extra": "^0.26.5",
7477
"gulp": "^3.9.0",
75-
"gulp-eslint": "^3.0.1",
78+
"gulp-eslint": "^5.0.0",
7679
"gulp-if": "^2.0.0",
7780
"gulp-istanbul": "^0.10.3",
7881
"gulp-mocha": "^2.2.0",
@@ -90,6 +93,6 @@
9093
"tmp": "0.0.28"
9194
},
9295
"peerDependencies": {
93-
"eslint": "^3.0.0"
96+
"eslint": "^4.19.1 || ^5.9.0"
9497
}
9598
}

‎packages/eslint-config-hudl/rules/react.js

+382-82
Large diffs are not rendered by default.

‎packages/eslint-config-hudl/tasks/docs/diffs/ConfigDiff.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ const fs = require('fs-extra');
55
const _ = require('lodash');
66
const tmp = require('tmp');
77
const Config = require('eslint/lib/config');
8+
const Linter = require('eslint/lib/linter');
89
const diff = require('deep-diff').diff;
910
const deepProperty = require('deep-property');
1011
const slash = require('slash');
@@ -334,7 +335,7 @@ ConfigDiff.prototype._loadConfig = function(configFilePath) {
334335
const config = new Config({
335336
configFile: configFilePath,
336337
useEslintrc: false,
337-
}).getConfig();
338+
}, new Linter()).getConfig();
338339

339340
// eslint resolves the parser option into an absolute file path. This isn't very helpful
340341
// to us. So we have to manually 'unresolve' it back to a module name if its a file path.

‎packages/eslint-config-hudl/tasks/docs/diffs/diffs-to-run.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ module.exports = [
22
{
33
// 'https://raw.githubusercontent.com/hudl/javascript/master/linters/.eslintrc',
44

5-
title: 'vs Airbnb v14.1.0',
5+
title: 'vs Airbnb v17.1.0',
66
outputName: 'with-airbnb-master',
77
base: require.resolve('../../../index.js'),
8-
comparison: 'eslint-config-airbnb@14.1.0',
8+
comparison: 'eslint-config-airbnb@17.1.0',
99
knownDifferences: {
1010
// Known rule differences
1111
rules: {

‎packages/eslint-config-hudl/test/__specs__/fixtures/static-props/test.jsx

+5-2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ import Feedback from '../Feedback';
1515
import Footer from '../Footer';
1616

1717
class App extends Component {
18+
static defaultProps = {
19+
context: undefined,
20+
error: undefined,
21+
}
1822

1923
static propTypes = {
2024
context: PropTypes.shape({
@@ -60,9 +64,8 @@ class App extends Component {
6064
<Feedback />
6165
<Footer />
6266
</div>
63-
) : this.props.children;
67+
) : this.props.children;
6468
}
65-
6669
}
6770

6871
export default App;

‎packages/eslint-config-hudl/test/original/test-react-order.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ const cli = new CLIEngine({
99

1010
// This rule fails when executing on text.
1111
rules: {
12-
indent: 0,
12+
'indent': 0,
13+
'padded-blocks': 0,
1314
},
1415
});
1516

‎packages/eslint-config-hudl/yarn.lock

+444-442
Large diffs are not rendered by default.

‎react/README.md

+484-122
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)
Please sign in to comment.