Skip to content

Commit

Permalink
Migrate to flat config
Browse files Browse the repository at this point in the history
  • Loading branch information
d3xter666 committed Jul 30, 2024
1 parent cd2f2c4 commit f89ed56
Show file tree
Hide file tree
Showing 5 changed files with 168 additions and 109 deletions.
3 changes: 0 additions & 3 deletions .eslintignore

This file was deleted.

102 changes: 0 additions & 102 deletions .eslintrc.cjs

This file was deleted.

132 changes: 132 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
import jsdoc from "eslint-plugin-jsdoc";
import globals from "globals";
import path from "node:path";
import {fileURLToPath} from "node:url";
import js from "@eslint/js";
import {FlatCompat} from "@eslint/eslintrc";

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all,
});

export default [
{
ignores: ["**/dist/", "**/coverage/", "**/docs/"],
},
...compat.extends("eslint:recommended", "google"),
{
plugins: {
jsdoc,
},

languageOptions: {
globals: {
...globals.node,
},

ecmaVersion: 2022,
sourceType: "module",
},

settings: {
jsdoc: {
tagNamePreference: {
return: "returns",
},
},
},

rules: {
"indent": ["error", "tab"],
"linebreak-style": ["error", "unix"],

"quotes": [
"error",
"double",
{
allowTemplateLiterals: true,
},
],

"semi": ["error", "always"],
"no-negated-condition": "off",
"require-jsdoc": "off",
"no-mixed-requires": "off",

"max-len": [
"error",
{
code: 120,
ignoreUrls: true,
ignoreRegExpLiterals: true,
},
],

"no-implicit-coercion": [
2,
{
allow: ["!!"],
},
],

"comma-dangle": "off",
"no-tabs": "off",
"valid-jsdoc": 0,
// Starting with ESLint v8, it needs to be disabled as it currently can't be supported
// See: https://github.com/eslint/eslint/issues/14745
"jsdoc/check-examples": 0,
"jsdoc/check-param-names": 2,
"jsdoc/check-tag-names": 2,
"jsdoc/check-types": 2,
"jsdoc/no-undefined-types": 0,
"jsdoc/require-description": 0,
"jsdoc/require-description-complete-sentence": 0,
"jsdoc/require-example": 0,
"jsdoc/require-hyphen-before-param-description": 0,
"jsdoc/require-param": 2,
"jsdoc/require-param-description": 0,
"jsdoc/require-param-name": 2,
"jsdoc/require-param-type": 2,
"jsdoc/require-returns": 0,
"jsdoc/require-returns-description": 0,
"jsdoc/require-returns-type": 2,

"jsdoc/tag-lines": [
2,
"any",
{
startLines: 1,
},
],

"jsdoc/valid-types": 0,
},
},
{
files: ["**/*.cjs"],

languageOptions: {
ecmaVersion: 2022,
sourceType: "script",
},
},
{
files: [
"lib/client/**",
"test/integration/*/webapp/**/*.js",
"test/integration/*/src/**/*.js",
"test/integration/*/test/**/*.js",
],

languageOptions: {
globals: {
...globals.browser,
sap: "readonly",
},
},
},
];
37 changes: 33 additions & 4 deletions package-lock.json

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

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@
"devDependencies": {
"@babel/core": "^7.24.9",
"@babel/preset-env": "^7.24.8",
"@eslint/eslintrc": "^3.1.0",
"@eslint/js": "^9.8.0",
"@istanbuljs/esm-loader-hook": "^0.2.0",
"@openui5/sap.ui.core": "^1.126.1",
"ava": "^6.1.3",
Expand All @@ -118,6 +120,7 @@
"esmock": "^2.6.7",
"execa": "^9.3.0",
"fast-glob": "^3.3.2",
"globals": "^15.8.0",
"istanbul-lib-coverage": "^3.2.2",
"karma": "^6.4.3",
"karma-chrome-launcher": "^3.2.0",
Expand Down

0 comments on commit f89ed56

Please sign in to comment.