Skip to content

Commit

Permalink
fix(linting): import linting fixes from cli-style
Browse files Browse the repository at this point in the history
  • Loading branch information
ismay committed Mar 11, 2021
1 parent faf42a2 commit b14feca
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 12 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/dhis2-verify-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ jobs:
path: '**/node_modules'
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}

# Can be removed if translations aren't required for linting to pass, or if not using the App Platform
- name: Generate translations
run: yarn d2-app-scripts i18n generate

- name: Lint
run: yarn lint

Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
"eslint-plugin-i18next": "^5.0.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-react-hooks": "^4.2.0",
"identity-obj-proxy": "^3.0.0",
"stylelint": "^13.11.0",
"stylelint-config-prettier": "^8.0.2",
Expand Down
10 changes: 5 additions & 5 deletions src/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@ const { config } = require('@dhis2/cli-style')

module.exports = {
root: true,
plugins: ['react-hooks', 'i18next'],
plugins: ['react-hooks', 'i18next', 'jsx-a11y'],
extends: [
config.eslintReact,
'plugin:jsx-a11y/recommended',
'plugin:compat/recommended',
],
rules: {
'compat/compat': 'warn',
'i18next/no-literal-string': [
'error',
{ markupOnly: true, onlyAttribute: [""] },
{ markupOnly: true, onlyAttribute: ["label"] },
],
'compat/compat': 'warn',
'import/export': 'error',
'import/extensions': ['error', 'never'],
'import/first': 'error',
Expand Down Expand Up @@ -54,11 +54,11 @@ module.exports = {
'import/order': ['error', { 'newlines-between': 'never' }],
'react/require-default-props': 'warn',
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
'react-hooks/exhaustive-deps': 'error',
},
overrides: [
{
files: ['*.test.js'],
files: ['*.test.js', '**/__tests__/*.js'],
rules: {
'i18next/no-literal-string': 'off',
'react/prop-types': 'off',
Expand Down
2 changes: 1 addition & 1 deletion src/components/App/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Store } from '../Store'
import { PageWrapper } from '../PageWrapper'
import './App.css'

// eslint-disable-next-line import/no-unassigned-import, import/no-unresolved
// eslint-disable-next-line import/no-unassigned-import
import '../../locales'
// The above is necessary for translations to work

Expand Down
5 changes: 0 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6241,11 +6241,6 @@ eslint-plugin-react-hooks@^1.6.1:
resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-1.7.0.tgz#6210b6d5a37205f0b92858f895a4e827020a7d04"
integrity sha512-iXTCFcOmlWvw4+TOE8CLWj6yX1GwzT0Y6cUfHHZqWnSk144VmVIRcVGtUAzrLES7C798lmvnt02C7rxaOX1HNA==

eslint-plugin-react-hooks@^4.2.0:
version "4.2.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.2.0.tgz#8c229c268d468956334c943bb45fc860280f5556"
integrity sha512-623WEiZJqxR7VdxFCKLI6d6LLpwJkGPYKODnkH3D7WpOG5KM8yWueBd8TLsNAetEJNF5iJmolaAKO3F8yzyVBQ==

[email protected]:
version "7.18.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.18.0.tgz#2317831284d005b30aff8afb7c4e906f13fa8e7e"
Expand Down

0 comments on commit b14feca

Please sign in to comment.