Skip to content

Commit

Permalink
feat(cs): add linting for cypress folder
Browse files Browse the repository at this point in the history
  • Loading branch information
phanan committed Jan 3, 2021
1 parent 4f260f9 commit 6b87deb
Show file tree
Hide file tree
Showing 8 changed files with 530 additions and 17 deletions.
26 changes: 26 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint"
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended"
],
"rules": {
"camelcase": 0,
"no-multi-str": 0,
"no-empty": 0,
"quotes": 0,
"@typescript-eslint/no-var-requires": 0,
"@typescript-eslint/camelcase": 0,
"@typescript-eslint/member-delimiter-style": 0,
"@typescript-eslint/consistent-type-assertions": 0,
"@typescript-eslint/no-inferrable-types": 0,
"@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/no-non-null-assertion": 0,
"@typescript-eslint/ban-ts-ignore": 0
}
}
2 changes: 2 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ jobs:
uses: actions/setup-node@v2
with:
node-version: 14
- name: Lint
run: yarn lint
- name: Install submodule dependencies
working-directory: ./resources/assets
run: yarn install
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/song-editing.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ context('Song Editing', { scrollBehavior: false }, () => {
cy.findByTestId('song-context-menu').within(() => cy.findByText('Edit').click())

cy.findByTestId('edit-song-form').within(() => {
;['title', 'track'].forEach(selector => {
['title', 'track'].forEach(selector => {
cy.get(`[name=${selector}]`).should('not.exist')
})

Expand Down
2 changes: 1 addition & 1 deletion cypress/plugins/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// https://on.cypress.io/plugins-guide
// ***********************************************************

export default (on, config) => {
export default (on: () => void, config: Record<string, unknown>): Record<string, unknown> => {
return Object.assign({}, config, {
supportFile: 'cypress/support/index.ts'
})
Expand Down
2 changes: 1 addition & 1 deletion cypress/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Cypress.Commands.add('$loginAsNonAdmin', (options: Partial<LoginOptions> = {}):
return cy.$login(options)
})

Cypress.Commands.add('$each', (dataset: Array<Array<any>>, callback: Function) => {
Cypress.Commands.add('$each', (dataset: Array<Array<any>>, callback: (...args) => void) => {
dataset.forEach(args => callback(...args))
})

Expand Down
3 changes: 0 additions & 3 deletions lint-staged.config.js

This file was deleted.

12 changes: 12 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,12 @@
},
"devDependencies": {
"@testing-library/cypress": "^7.0.3",
"@typescript-eslint/eslint-plugin": "^4.11.1",
"@typescript-eslint/parser": "^4.11.1",
"cross-env": "^3.2.3",
"cypress": "^6.2.0",
"cypress-file-upload": "^4.1.1",
"eslint": "^7.17.0",
"font-awesome": "^4.7.0",
"husky": "^4.2.5",
"kill-port": "^1.6.1",
Expand All @@ -34,6 +37,7 @@
"webpack-node-externals": "^1.6.0"
},
"scripts": {
"lint": "eslint ./cypress/**/*.ts",
"watch": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch-poll": "yarn watch -- --watch-poll",
"hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
Expand All @@ -49,5 +53,13 @@
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"**/*.php": [
"composer cs"
],
"**/*.ts": [
"eslint"
]
}
}
Loading

0 comments on commit 6b87deb

Please sign in to comment.