diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 00000000..ca7f1bac --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,42 @@ +import typescriptEslint from "@typescript-eslint/eslint-plugin"; +import globals from "globals"; +import tsParser from "@typescript-eslint/parser"; + +export default [ + { + ignores: [ + "**/node_modules", + "**/dist", + "**/templates", + "**/spec", + "**/.eslintrc.json", + "**/lib", + "**/bin", + ], + }, + { + plugins: { + "@typescript-eslint": typescriptEslint, + }, + + languageOptions: { + globals: { + ...globals.node, + }, + + parser: tsParser, + ecmaVersion: 2023, + sourceType: "module", + + parserOptions: { + project: "tsconfig.json", + tsconfigRootDir: ".", + }, + }, + + rules: { + "no-unused-vars": "off", + "@typescript-eslint/no-unused-vars": "error", + }, + } +]; \ No newline at end of file diff --git a/templates/visuals/_global/tslint.json b/templates/visuals/_global/tslint.json deleted file mode 100644 index 8eb111c0..00000000 --- a/templates/visuals/_global/tslint.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "rules": { - "class-name": true, - "comment-format": [ - true, - "check-space" - ], - "indent": [ - true, - "spaces" - ], - "no-duplicate-variable": true, - "no-eval": true, - "no-internal-module": false, - "no-trailing-whitespace": true, - "no-unsafe-finally": true, - "no-var-keyword": true, - "one-line": [ - true, - "check-open-brace", - "check-whitespace" - ], - "quotemark": [ - false, - "double" - ], - "semicolon": [ - true, - "always" - ], - "triple-equals": [ - true, - "allow-null-check" - ], - "typedef-whitespace": [ - true, - { - "call-signature": "nospace", - "index-signature": "nospace", - "parameter": "nospace", - "property-declaration": "nospace", - "variable-declaration": "nospace" - } - ], - "variable-name": [ - true, - "ban-keywords" - ], - "whitespace": [ - true, - "check-branch", - "check-decl", - "check-operator", - "check-separator", - "check-type" - ], - "insecure-random": true, - "no-banned-terms": true, - "no-cookies": true, - "no-delete-expression": true, - "no-disable-auto-sanitization": true, - "no-document-domain": true, - "no-document-write": true, - "no-exec-script": true, - "no-function-constructor-with-string-args": true, - "no-http-string": [true, "http://www.example.com/?.*", "http://www.examples.com/?.*"], - "no-inner-html": true, - "no-octal-literal": true, - "no-reserved-keywords": true, - "no-string-based-set-immediate": true, - "no-string-based-set-interval": true, - "no-string-based-set-timeout": true, - "non-literal-require": true, - "possible-timing-attack": true, - "react-anchor-blank-noopener": true, - "react-iframe-missing-sandbox": true, - "react-no-dangerous-html": true - } -} diff --git a/templates/visuals/default/.eslintignore b/templates/visuals/default/.eslintignore deleted file mode 100644 index fc6204f9..00000000 --- a/templates/visuals/default/.eslintignore +++ /dev/null @@ -1,5 +0,0 @@ -assets -style -dist -node_modules -.eslintrc.js \ No newline at end of file diff --git a/templates/visuals/default/.eslintrc.js b/templates/visuals/default/.eslintrc.js deleted file mode 100644 index 42f26710..00000000 --- a/templates/visuals/default/.eslintrc.js +++ /dev/null @@ -1,20 +0,0 @@ -module.exports = { - env: { - "browser": true, - "es6": true, - "es2017": true - }, - root: true, - parser: "@typescript-eslint/parser", - parserOptions: { - project: "tsconfig.json", - tsconfigRootDir: ".", - }, - plugins: [ - "powerbi-visuals" - ], - extends: [ - "plugin:powerbi-visuals/recommended" - ], - rules: {} -}; \ No newline at end of file diff --git a/templates/visuals/default/eslint.config.mjs b/templates/visuals/default/eslint.config.mjs new file mode 100644 index 00000000..53a785b1 --- /dev/null +++ b/templates/visuals/default/eslint.config.mjs @@ -0,0 +1,8 @@ +import powerbiVisualsConfigs from "eslint-plugin-powerbi-visuals"; + +export default [ + powerbiVisualsConfigs.configs.recommended, + { + ignores: ["node_modules/**", "dist/**", ".vscode/**", ".tmp/**"], + }, +]; \ No newline at end of file diff --git a/templates/visuals/default/package.json b/templates/visuals/default/package.json index dff832ab..8cbe29ea 100644 --- a/templates/visuals/default/package.json +++ b/templates/visuals/default/package.json @@ -11,18 +11,18 @@ "pbiviz": "pbiviz", "start": "pbiviz start", "package": "pbiviz package", - "lint": "npx eslint . --ext .js,.jsx,.ts,.tsx" + "lint": "npx eslint ." }, "dependencies": { - "@types/d3": "7.4.0", - "d3": "7.8.5", - "powerbi-visuals-api": "5.4.0", - "powerbi-visuals-utils-formattingmodel": "6.0.0" + "@types/d3": "7.4.3", + "d3": "7.9.0", + "powerbi-visuals-api": "5.11.0", + "powerbi-visuals-utils-formattingmodel": "6.0.4" }, "devDependencies": { - "@typescript-eslint/eslint-plugin": "^5.59.11", - "eslint": "^8.42.0", - "eslint-plugin-powerbi-visuals": "^0.8.1", - "typescript": "4.9.3" + "@typescript-eslint/eslint-plugin": "^8.8.0", + "eslint": "^9.11.1", + "eslint-plugin-powerbi-visuals": "^1.0.0", + "typescript": "5.5.4" } } \ No newline at end of file diff --git a/templates/visuals/rhtml/.eslintignore b/templates/visuals/rhtml/.eslintignore deleted file mode 100644 index fc6204f9..00000000 --- a/templates/visuals/rhtml/.eslintignore +++ /dev/null @@ -1,5 +0,0 @@ -assets -style -dist -node_modules -.eslintrc.js \ No newline at end of file diff --git a/templates/visuals/rhtml/.eslintrc.js b/templates/visuals/rhtml/.eslintrc.js deleted file mode 100644 index 42f26710..00000000 --- a/templates/visuals/rhtml/.eslintrc.js +++ /dev/null @@ -1,20 +0,0 @@ -module.exports = { - env: { - "browser": true, - "es6": true, - "es2017": true - }, - root: true, - parser: "@typescript-eslint/parser", - parserOptions: { - project: "tsconfig.json", - tsconfigRootDir: ".", - }, - plugins: [ - "powerbi-visuals" - ], - extends: [ - "plugin:powerbi-visuals/recommended" - ], - rules: {} -}; \ No newline at end of file diff --git a/templates/visuals/rhtml/eslint.config.mjs b/templates/visuals/rhtml/eslint.config.mjs new file mode 100644 index 00000000..53a785b1 --- /dev/null +++ b/templates/visuals/rhtml/eslint.config.mjs @@ -0,0 +1,8 @@ +import powerbiVisualsConfigs from "eslint-plugin-powerbi-visuals"; + +export default [ + powerbiVisualsConfigs.configs.recommended, + { + ignores: ["node_modules/**", "dist/**", ".vscode/**", ".tmp/**"], + }, +]; \ No newline at end of file diff --git a/templates/visuals/rhtml/package.json b/templates/visuals/rhtml/package.json index 11c946e9..ceddd677 100644 --- a/templates/visuals/rhtml/package.json +++ b/templates/visuals/rhtml/package.json @@ -4,17 +4,17 @@ "powerbi-visuals-utils-formattingmodel": "6.0.0" }, "devDependencies": { - "powerbi-visuals-api": "5.4.0", - "ts-loader": "9.4.3", - "@typescript-eslint/eslint-plugin": "^5.59.11", - "eslint": "^8.42.0", - "eslint-plugin-powerbi-visuals": "^0.8.1", - "typescript": "5.1.3" + "powerbi-visuals-api": "5.11.0", + "ts-loader": "9.5.1", + "@typescript-eslint/eslint-plugin": "^8.8.0", + "eslint": "^9.11.1", + "eslint-plugin-powerbi-visuals": "^1.0.0", + "typescript": "5.5.4" }, "scripts": { "pbiviz": "pbiviz", "start": "pbiviz start", "package": "pbiviz package", - "lint": "npx eslint . --ext .js,.jsx,.ts,.tsx" + "lint": "npx eslint ." } } diff --git a/templates/visuals/rhtml/src/htmlInjectionUtility.ts b/templates/visuals/rhtml/src/htmlInjectionUtility.ts index 043259e0..ba46dfbf 100644 --- a/templates/visuals/rhtml/src/htmlInjectionUtility.ts +++ b/templates/visuals/rhtml/src/htmlInjectionUtility.ts @@ -39,7 +39,7 @@ function createScriptNode(refNode: Element): HTMLElement { }; } } - // tslint:disable-next-line + script.innerHTML = refNode.innerHTML; return script; } diff --git a/templates/visuals/rhtml/src/visual.ts b/templates/visuals/rhtml/src/visual.ts index e77acfa8..e55c5094 100644 --- a/templates/visuals/rhtml/src/visual.ts +++ b/templates/visuals/rhtml/src/visual.ts @@ -128,7 +128,6 @@ export class Visual implements IVisual { } public onResizing(finalViewport: IViewport): void { - // tslint:disable-next-line /* add code to handle resizing of the view port */ } @@ -146,7 +145,6 @@ export class Visual implements IVisual { // create 'virtual' HTML, so parsing is easier let el: HTMLHtmlElement = document.createElement("html"); try { - // tslint:disable-next-line el.innerHTML = window.atob(payloadBase64); } catch (err) { return; diff --git a/templates/visuals/rvisual/.eslintignore b/templates/visuals/rvisual/.eslintignore deleted file mode 100644 index fc6204f9..00000000 --- a/templates/visuals/rvisual/.eslintignore +++ /dev/null @@ -1,5 +0,0 @@ -assets -style -dist -node_modules -.eslintrc.js \ No newline at end of file diff --git a/templates/visuals/rvisual/.eslintrc.js b/templates/visuals/rvisual/.eslintrc.js deleted file mode 100644 index 42f26710..00000000 --- a/templates/visuals/rvisual/.eslintrc.js +++ /dev/null @@ -1,20 +0,0 @@ -module.exports = { - env: { - "browser": true, - "es6": true, - "es2017": true - }, - root: true, - parser: "@typescript-eslint/parser", - parserOptions: { - project: "tsconfig.json", - tsconfigRootDir: ".", - }, - plugins: [ - "powerbi-visuals" - ], - extends: [ - "plugin:powerbi-visuals/recommended" - ], - rules: {} -}; \ No newline at end of file diff --git a/templates/visuals/rvisual/eslint.config.mjs b/templates/visuals/rvisual/eslint.config.mjs new file mode 100644 index 00000000..53a785b1 --- /dev/null +++ b/templates/visuals/rvisual/eslint.config.mjs @@ -0,0 +1,8 @@ +import powerbiVisualsConfigs from "eslint-plugin-powerbi-visuals"; + +export default [ + powerbiVisualsConfigs.configs.recommended, + { + ignores: ["node_modules/**", "dist/**", ".vscode/**", ".tmp/**"], + }, +]; \ No newline at end of file diff --git a/templates/visuals/rvisual/package.json b/templates/visuals/rvisual/package.json index 80317af5..62646eeb 100644 --- a/templates/visuals/rvisual/package.json +++ b/templates/visuals/rvisual/package.json @@ -4,16 +4,16 @@ "powerbi-visuals-utils-formattingmodel": "6.0.0" }, "devDependencies": { - "powerbi-visuals-api": "5.4.0", - "@typescript-eslint/eslint-plugin": "^5.59.11", - "eslint": "^8.42.0", - "eslint-plugin-powerbi-visuals": "^0.8.1", - "typescript": "4.9.3" + "powerbi-visuals-api": "5.11.0", + "@typescript-eslint/eslint-plugin": "^8.8.0", + "eslint": "^9.11.1", + "eslint-plugin-powerbi-visuals": "^1.0.0", + "typescript": "5.5.4" }, "scripts": { "pbiviz": "pbiviz", "start": "pbiviz start", "package": "pbiviz package", - "lint": "tslint -c tslint.json -p tsconfig.json" + "lint": "eslint ." } } diff --git a/templates/visuals/slicer/.eslintignore b/templates/visuals/slicer/.eslintignore deleted file mode 100644 index fc6204f9..00000000 --- a/templates/visuals/slicer/.eslintignore +++ /dev/null @@ -1,5 +0,0 @@ -assets -style -dist -node_modules -.eslintrc.js \ No newline at end of file diff --git a/templates/visuals/slicer/.eslintrc.js b/templates/visuals/slicer/.eslintrc.js deleted file mode 100644 index 42f26710..00000000 --- a/templates/visuals/slicer/.eslintrc.js +++ /dev/null @@ -1,20 +0,0 @@ -module.exports = { - env: { - "browser": true, - "es6": true, - "es2017": true - }, - root: true, - parser: "@typescript-eslint/parser", - parserOptions: { - project: "tsconfig.json", - tsconfigRootDir: ".", - }, - plugins: [ - "powerbi-visuals" - ], - extends: [ - "plugin:powerbi-visuals/recommended" - ], - rules: {} -}; \ No newline at end of file diff --git a/templates/visuals/slicer/eslint.config.mjs b/templates/visuals/slicer/eslint.config.mjs new file mode 100644 index 00000000..53a785b1 --- /dev/null +++ b/templates/visuals/slicer/eslint.config.mjs @@ -0,0 +1,8 @@ +import powerbiVisualsConfigs from "eslint-plugin-powerbi-visuals"; + +export default [ + powerbiVisualsConfigs.configs.recommended, + { + ignores: ["node_modules/**", "dist/**", ".vscode/**", ".tmp/**"], + }, +]; \ No newline at end of file diff --git a/templates/visuals/slicer/package.json b/templates/visuals/slicer/package.json index adc37b6c..5d43a70b 100644 --- a/templates/visuals/slicer/package.json +++ b/templates/visuals/slicer/package.json @@ -4,18 +4,18 @@ "pbiviz": "pbiviz", "start": "pbiviz start", "package": "pbiviz package", - "lint": "npx eslint . --ext .js,.jsx,.ts,.tsx" + "lint": "npx eslint ." }, "dependencies": { - "d3": "7.8.5", - "powerbi-visuals-utils-formattingmodel": "6.0.0" + "d3": "7.9.0", + "powerbi-visuals-utils-formattingmodel": "6.0.4" }, "devDependencies": { - "@types/d3": "7.4.0", - "powerbi-visuals-api": "5.4.0", - "@typescript-eslint/eslint-plugin": "^5.59.11", - "eslint": "^8.42.0", - "eslint-plugin-powerbi-visuals": "^0.8.1", - "typescript": "4.9.3" + "@types/d3": "7.4.3", + "powerbi-visuals-api": "5.11.0", + "@typescript-eslint/eslint-plugin": "^8.8.0", + "eslint": "^9.11.1", + "eslint-plugin-powerbi-visuals": "^1.0.0", + "typescript": "5.5.4" } } \ No newline at end of file diff --git a/templates/visuals/table/.eslintignore b/templates/visuals/table/.eslintignore deleted file mode 100644 index fc6204f9..00000000 --- a/templates/visuals/table/.eslintignore +++ /dev/null @@ -1,5 +0,0 @@ -assets -style -dist -node_modules -.eslintrc.js \ No newline at end of file diff --git a/templates/visuals/table/.eslintrc.js b/templates/visuals/table/.eslintrc.js deleted file mode 100644 index 42f26710..00000000 --- a/templates/visuals/table/.eslintrc.js +++ /dev/null @@ -1,20 +0,0 @@ -module.exports = { - env: { - "browser": true, - "es6": true, - "es2017": true - }, - root: true, - parser: "@typescript-eslint/parser", - parserOptions: { - project: "tsconfig.json", - tsconfigRootDir: ".", - }, - plugins: [ - "powerbi-visuals" - ], - extends: [ - "plugin:powerbi-visuals/recommended" - ], - rules: {} -}; \ No newline at end of file diff --git a/templates/visuals/table/eslint.config.mjs b/templates/visuals/table/eslint.config.mjs new file mode 100644 index 00000000..53a785b1 --- /dev/null +++ b/templates/visuals/table/eslint.config.mjs @@ -0,0 +1,8 @@ +import powerbiVisualsConfigs from "eslint-plugin-powerbi-visuals"; + +export default [ + powerbiVisualsConfigs.configs.recommended, + { + ignores: ["node_modules/**", "dist/**", ".vscode/**", ".tmp/**"], + }, +]; \ No newline at end of file diff --git a/templates/visuals/table/package.json b/templates/visuals/table/package.json index 0ac78c9a..c44cb2cd 100644 --- a/templates/visuals/table/package.json +++ b/templates/visuals/table/package.json @@ -4,18 +4,18 @@ "pbiviz": "pbiviz", "start": "pbiviz start", "package": "pbiviz package", - "lint": "npx eslint . --ext .js,.jsx,.ts,.tsx" + "lint": "npx eslint ." }, "dependencies": { - "d3": "7.8.5", - "powerbi-visuals-utils-formattingmodel": "6.0.0" + "d3": "7.9.0", + "powerbi-visuals-utils-formattingmodel": "6.0.4" }, "devDependencies": { - "powerbi-visuals-api": "5.4.0", - "@types/d3": "7.4.0", - "@typescript-eslint/eslint-plugin": "^5.59.11", - "eslint": "^8.42.0", - "eslint-plugin-powerbi-visuals": "^0.8.1", - "typescript": "4.9.3" + "powerbi-visuals-api": "5.11.0", + "@types/d3": "7.4.3", + "@typescript-eslint/eslint-plugin": "^8.8.0", + "eslint": "^9.11.1", + "eslint-plugin-powerbi-visuals": "^1.0.0", + "typescript": "5.5.4" } } \ No newline at end of file