Skip to content

Commit

Permalink
Updated eslint + packages, reworked eslint to use default config (#525)
Browse files Browse the repository at this point in the history
* Updated eslint + packages, reworked eslint to use default config

* Updated templates

* Fixed eslint config

* Fixed vulnerabilities

* Updated eslint plugin package

* Fixed api version check

* Fixed middleware
  • Loading branch information
AleksSavelev authored Oct 4, 2024
1 parent 4e5afc6 commit 4da6caf
Show file tree
Hide file tree
Showing 38 changed files with 870 additions and 968 deletions.
7 changes: 0 additions & 7 deletions .eslintignore

This file was deleted.

5 changes: 5 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

This page contains information about changes to the PowerBI Visual Tools (pbiviz).

## 5.6.0
* Updated to ESLint v9
* Updated to TypeScript v5
* `--use-default` flag for `pbiviz package` and `pbiviz lint` commands is deprecated. Recommeded config is used by default

## 5.5.1
* Fixed subtotal feature check

Expand Down
4 changes: 1 addition & 3 deletions bin/pbiviz.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ pbiviz
pbiviz
.command('lint')
.option('--fix', 'Enable autofixing of lint errors')
.option('--use-default', 'Use recommended eslintrc file')
.action(options => {
CommandManager.lint({ ...options, verbose: true }, rootPath);
});
Expand All @@ -85,7 +84,7 @@ pbiviz
.option('--no-stats', "Doesn't generate statistics files")
.option('--skip-api', "Skips powerbi-visuals-api verifying")
.option('-l, --all-locales', "Keeps all locale files in the package. By default only used inside stringResources folder locales are included.")
.option('-p, --pbiviz-file <pbiviz-file>', "Path to pbiviz.json file (useful for debugging)", pbivizFile)
.option('-f, --pbiviz-file <pbiviz-file>', "Path to pbiviz.json file (useful for debugging)", pbivizFile)
.action(async (options) => {
CommandManager.start(options, rootPath);
});
Expand All @@ -101,7 +100,6 @@ pbiviz
.option('-l, --all-locales', "Keeps all locale files in the package. By default only used inside stringResources folder locales are included.")
.option('-v, --verbose', "Enables verbose logging")
.option('--fix', 'Enable autofixing of lint errors')
.option('--use-default', 'Use recommended eslintrc file')
.option('-p, --pbiviz-file <pbiviz-file>', "Path to pbiviz.json file (useful for debugging)", pbivizFile)
.addOption(new Option('-c, --compression <compressionLevel>', "Enables compression of visual package")
.choices(['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'])
Expand Down
37 changes: 37 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import typescriptEslint from "@typescript-eslint/eslint-plugin";
import globals from "globals";
import tsParser from "@typescript-eslint/parser";

export default [
{
files: ["*.ts", "*tsx"],
ignores: [
"node_modules/",
"dist/",
"templates/",
"spec/*/**",
"**/lib/",
"bin/",
"eslint.config.mjs",
],
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",
},
}
];
Loading

0 comments on commit 4da6caf

Please sign in to comment.