Skip to content

Commit

Permalink
Migrate to eslint 9
Browse files Browse the repository at this point in the history
  • Loading branch information
otacke committed Apr 8, 2024
1 parent 46ba678 commit 30d9c95
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 55 deletions.
50 changes: 0 additions & 50 deletions .eslintrc.json

This file was deleted.

52 changes: 52 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@

import globals from 'globals';
import jsdoc from 'eslint-plugin-jsdoc';

export default [
jsdoc.configs['flat/recommended'],
{
name: 'eslint-config-snordian-h5p',
files: ['**/*.js'],
languageOptions: {
ecmaVersion: 2020,
sourceType: 'module',
globals: {
...globals.browser,
H5P: 'readonly',
H5PEditor: 'readonly',
H5PIntegration: 'readonly'
}
},
rules: {
semi: ['error', 'always'],
indent: ['error', 2, { 'SwitchCase': 1 }],
'brace-style': ['error', 'stroustrup'],
'keyword-spacing': ['error', { 'after': true }],
'comma-spacing': ['error', { 'before': false, 'after': true }],
'space-infix-ops': ['error', { 'int32Hint': false }],
eqeqeq: ['error', 'smart'],
'space-before-blocks': 'error',
'space-before-function-paren': ['error', {
'anonymous': 'always',
'named': 'never',
'asyncArrow': 'always'
}],
'no-extra-boolean-cast': 'off',
'no-console': ['error', { 'allow': ['warn', 'error'] }],
quotes: ['error', 'single'],
'arrow-parens': ['error', 'always'],
'object-curly-spacing': ['error', 'always'],
'no-alert': ['error'],
},
plugins: {
jsdoc
},
settings: {
jsdoc: {
preferredTypes: {
Function: 'function'
}
}
}
}
];
31 changes: 26 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
},
"dependencies": {
"color": "^4.2.3",
"globals": "^15.0.0",
"he": "^1.2.0"
},
"browserslist": "> 0.5%, last 2 versions, Firefox ESR, not dead"
Expand Down

0 comments on commit 30d9c95

Please sign in to comment.