Skip to content

Commit

Permalink
Update eslint rules.
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeer committed Dec 19, 2024
1 parent 06e4048 commit 3278b66
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 18 deletions.
4 changes: 0 additions & 4 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
dist/
config/
coverage/
node_modules/
lib/
es/
umd/
88 changes: 78 additions & 10 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,19 +1,87 @@
{
"env": {},
"extends": ["airbnb", "plugin:jest/recommended"],
"parserOptions": {
"ecmaVersion": 2022,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
}
},
"extends": [
"airbnb",
"plugin:react/recommended",
"plugin:react-hooks/recommended",
"plugin:testing-library/react"
],
"globals": {
"document": true
"page": true,
"document": true,
"vi": true
},
"parser": "@babel/eslint-parser",
"plugins": ["babel", "jest", "react", "react-hooks"],
"plugins": [
"react",
"react-hooks",
"testing-library"
],
"rules": {
"import/no-unresolved": [
2, { "ignore": ["test-utils"] }
],
"import/prefer-default-export": "off",
"import/no-extraneous-dependencies": "off",
"no-console": "warn",
"no-console": "off",
"no-unused-expressions": ["error", { "allowShortCircuit": true, "allowTernary": true }],
"no-unused-vars": "off",
"no-undef": "off",
"no-restricted-syntax": ["warn", "WithStatement"],
"no-restricted-globals": ["error"],
"eqeqeq": ["warn", "smart"],
"no-use-before-define": [
"warn",
{
"functions": false,
"classes": false,
"variables": false
},
],
"no-mixed-operators": [
"warn",
{
"groups": [
["&", "|", "^", "~", "<<", ">>", ">>>"],
["==", "!=", "===", "!==", ">", ">=", "<", "<="],
["&&", "||"],
["in", "instanceof"],
],
"allowSamePrecedence": false,
},
],
"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }],
"react/jsx-fragments": "off",
"react/jsx-props-no-spreading": "off",
"no-underscore-dangle": "off",
"react/prefer-stateless-function": "off",
"react/function-component-definition": "off"
"react/jsx-props-no-spreading": "off",
"react/function-component-definition": "off",
"default-param-last": "off",
"arrow-parens": "off",
"import/no-anonymous-default-export": "off",
"import/no-extraneous-dependencies": "off",
"max-len": ["error", {
"code": 120,
"ignoreComments": true,
"ignoreStrings": true,
"ignoreTemplateLiterals": true,
"ignoreRegExpLiterals": true
}],
"react/jsx-uses-react": "off",
"react/react-in-jsx-scope": "off",
"react/require-default-props": [2, {
"functions": "defaultArguments"
}],
"react-hooks/exhaustive-deps": "error",
"testing-library/render-result-naming-convention": "off",
"testing-library/no-render-in-lifecycle": [
"error",
{
"allowTestingFrameworkSetupHook": "beforeEach"
}
]
}
}
4 changes: 2 additions & 2 deletions src/CanvasDownloadLinks.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ export default class CanvasDownloadLinks extends Component {
const { canvas, canvasLabel } = this.props;

return (
<React.Fragment>
<>
<Typography noWrap variant="h3" sx={{ marginTop: '20px' }}>
{canvasLabel}
</Typography>
Expand All @@ -210,7 +210,7 @@ export default class CanvasDownloadLinks extends Component {
<RenderingDownloadLink rendering={rendering} key={rendering.id} />
))}
</List>
</React.Fragment>
</>
);
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/ManifestDownloadLinks.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default class ManifestDownloadLinks extends Component {
const { renderings, t } = this.props;

return (
<React.Fragment>
<>
<Typography variant="h3" sx={{ marginTop: '20px' }}>
{t('mirador-dl-plugin.other_download')}
</Typography>
Expand All @@ -25,7 +25,7 @@ export default class ManifestDownloadLinks extends Component {
<RenderingDownloadLink rendering={rendering} key={rendering.id} />
))}
</List>
</React.Fragment>
</>
);
}
}
Expand Down

0 comments on commit 3278b66

Please sign in to comment.