Skip to content

Commit

Permalink
fixed linting issues & pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
Veeti Laine committed Jul 11, 2024
1 parent d713621 commit b84c2ff
Show file tree
Hide file tree
Showing 13 changed files with 3,556 additions and 347 deletions.
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
build
48 changes: 48 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
module.exports = {
'env': {
'commonjs': true,
'browser': true,
'es2021': true,
'node': true,
'jest': true
},
'extends': ['eslint:recommended', 'plugin:react/recommended'],
'parserOptions': {
'ecmaFeatures': {
'jsx': true
},
'sourceType': 'module',
'ecmaVersion': 'latest'
},
'plugins': [
'react', 'cypress'
],
'rules': {
'indent': [
'error',
4
],
'linebreak-style': [
'error',
'unix'
],
'quotes': [
'error',
'single'
],
'semi': [
'error',
'always'
],
'eqeqeq': 'error',
'no-trailing-spaces': 'error',
'object-curly-spacing': [
'error', 'always'
],
'arrow-spacing': [
'error', { 'before': true, 'after': true }
],
'no-console': 0
},
'ignorePatterns': ['build/*']
};
4 changes: 2 additions & 2 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: '20'
- run: npm install
- run: npm run eslint
- run: npm install && cd frontend && npm install
- run: npm run eslint && cd frontend && npm run eslint
- run: npm run build
- run: npm run test
- name: e2e tests
Expand Down
2 changes: 1 addition & 1 deletion app.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ app.use(tokenExtractor);
app.use('/api/login', loginRouter);
app.use('/api/blogs', blogsRouter);
app.use('/api/users', userRouter);
app.use(express.static('frontend/build'))
app.use(express.static('frontend/build'));

if(process.env.NODE_ENV === 'test') {
const testingRouter = require('./controllers/testing');
Expand Down
1 change: 1 addition & 0 deletions frontend/cypress/e2e/bloglist.cy.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable no-undef */
describe('Bloglist app', function() {
beforeEach(function() {
cy.request('POST', `${Cypress.env('BACKEND')}/testing/reset`);
Expand Down
1 change: 1 addition & 0 deletions frontend/cypress/support/commands.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable no-undef */
Cypress.Commands.add('login', ({ username, password }) => {
cy.request('POST', `${Cypress.env('BACKEND')}/login`, {
username, password
Expand Down
Loading

0 comments on commit b84c2ff

Please sign in to comment.