Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run lint in CI step #3

Merged
merged 2 commits into from
Jun 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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