Skip to content

Commit

Permalink
Merge pull request #3 from CovEducation/mi-yu/lint-ci
Browse files Browse the repository at this point in the history
Run lint in CI step
  • Loading branch information
sanjayyepuri committed Jun 25, 2020
2 parents cc29795 + 22cc3c9 commit c4deeec
Show file tree
Hide file tree
Showing 11 changed files with 1,021 additions and 71 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ jobs:
script:
- npx lerna run --scope coved-server test
- npx lerna run --scope coved-client test
- npx lerna run lint
- stage: publish
if: branch = master
script:
Expand Down
17 changes: 14 additions & 3 deletions packages/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,21 @@
"start": "react-scripts start",
"build": "npx react-scripts build",
"test": "npx react-scripts test --watchAll=false",
"eject": "react-scripts eject"
"eject": "react-scripts eject",
"lint": "npx eslint src/**/*.js"
},
"eslintConfig": {
"extends": "react-app"
"extends": "react-app",
"rules": {
"quotes": [
"error",
"single"
],
"object-curly-spacing": [
"error",
"always"
]
}
},
"proxy": "http://localhost:8080",
"browserslist": {
Expand All @@ -32,4 +43,4 @@
"last 1 safari version"
]
}
}
}
11 changes: 5 additions & 6 deletions packages/client/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@ import logo from './logo.svg';
import './App.css';

function App() {

var [apiStatus, setApiStatus] = useState(null);

useEffect(() => {
fetch("/heartbeat")
.then(res => res.text())
.then(data => setApiStatus(data))
.catch(err => console.log(err));
fetch('/heartbeat')
.then((res) => res.text())
.then((data) => setApiStatus(data))
.catch((err) => console.log(err));
}, []);

return (
Expand All @@ -28,7 +27,7 @@ function App() {
>
Learn React
</a>
{ apiStatus }
{apiStatus}
</header>
</div>
);
Expand Down
8 changes: 3 additions & 5 deletions packages/server/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,11 @@ module.exports = {
commonjs: true,
es2020: true,
node: true,
jest: true,
},
extends: [
'airbnb-base',
],
extends: ['airbnb-base'],
parserOptions: {
ecmaVersion: 11,
},
rules: {
},
rules: {},
};
4 changes: 2 additions & 2 deletions packages/server/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ const usersRouter = require('./routes/users');
const app = express();

// disable logging when running unit tests
if (process.env.NODE_ENV !== "test") {
app.use(logger('dev'));
if (process.env.NODE_ENV !== 'test') {
app.use(logger('dev'));
}

app.use(express.json());
Expand Down

0 comments on commit c4deeec

Please sign in to comment.