Skip to content

Commit

Permalink
refactor: updated to eslint 9, dropped airbnb preset
Browse files Browse the repository at this point in the history
* refactor: removed unused eslint packages

* refactor: updated to eslint 9, dropped airbnb preset

* refactor: fixed react demo components
  • Loading branch information
sr258 authored Dec 29, 2024
1 parent ea580c5 commit 35d353a
Show file tree
Hide file tree
Showing 33 changed files with 493 additions and 698 deletions.
11 changes: 0 additions & 11 deletions .eslintignore

This file was deleted.

83 changes: 0 additions & 83 deletions .eslintrc.js

This file was deleted.

68 changes: 68 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
import globals from "globals";
import pluginJs from "@eslint/js";
import tseslint from "typescript-eslint";
import pluginReact from "eslint-plugin-react";
import eslintConfigPrettier from "eslint-config-prettier";

/** @type {import('eslint').Linter.Config[]} */
export default [
{
files: ["**/*.{js,mjs,cjs,ts,jsx,tsx}"],
},
{
ignores: [
'**/build/',
'**/build-ide/',
'**/coverage/',
'**/test/data/',
'scripts/',
'packages/h5p-examples/h5p/',
'packages/h5p-rest-example-server/h5p/',
'**/node_modules/',
'**/*.d.ts',
'**/*.config.js',
'packages/h5p-html-exporter/src/**/*.js',]
},
{ languageOptions: { globals: { ...globals.browser, ...globals.node } } },
pluginJs.configs.recommended,
...tseslint.configs.recommended,
pluginReact.configs.flat.recommended,
{
settings: {
react: {
"version": "18"
}
}
},
eslintConfigPrettier,
{
rules: {
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unused-vars": ["warn",
{ "argsIgnorePattern": "^_" }
],
"no-console": "warn",
"no-await-in-loop": "warn", // TODO : make error later
"no-param-reassign": "error",
"react/prop-types": "warn", // TODO : make error later
'@typescript-eslint/member-ordering': [
'error',
{
default: [
'public-constructor',
'private-constructor',
'public-static-field',
'private-static-field',
'public-instance-field',
'private-instance-field',
'public-static-method',
'private-static-method',
'public-instance-method',
'private-instance-method'
]
}
],

}
}
];
Loading

0 comments on commit 35d353a

Please sign in to comment.