Skip to content

Commit 4da6caf

Browse files
authored
Updated eslint + packages, reworked eslint to use default config (#525)
* 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
1 parent 4e5afc6 commit 4da6caf

38 files changed

+870
-968
lines changed

.eslintignore

-7
This file was deleted.

Changelog.md

+5
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

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

5+
## 5.6.0
6+
* Updated to ESLint v9
7+
* Updated to TypeScript v5
8+
* `--use-default` flag for `pbiviz package` and `pbiviz lint` commands is deprecated. Recommeded config is used by default
9+
510
## 5.5.1
611
* Fixed subtotal feature check
712

bin/pbiviz.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ pbiviz
7272
pbiviz
7373
.command('lint')
7474
.option('--fix', 'Enable autofixing of lint errors')
75-
.option('--use-default', 'Use recommended eslintrc file')
7675
.action(options => {
7776
CommandManager.lint({ ...options, verbose: true }, rootPath);
7877
});
@@ -85,7 +84,7 @@ pbiviz
8584
.option('--no-stats', "Doesn't generate statistics files")
8685
.option('--skip-api', "Skips powerbi-visuals-api verifying")
8786
.option('-l, --all-locales', "Keeps all locale files in the package. By default only used inside stringResources folder locales are included.")
88-
.option('-p, --pbiviz-file <pbiviz-file>', "Path to pbiviz.json file (useful for debugging)", pbivizFile)
87+
.option('-f, --pbiviz-file <pbiviz-file>', "Path to pbiviz.json file (useful for debugging)", pbivizFile)
8988
.action(async (options) => {
9089
CommandManager.start(options, rootPath);
9190
});
@@ -101,7 +100,6 @@ pbiviz
101100
.option('-l, --all-locales', "Keeps all locale files in the package. By default only used inside stringResources folder locales are included.")
102101
.option('-v, --verbose', "Enables verbose logging")
103102
.option('--fix', 'Enable autofixing of lint errors')
104-
.option('--use-default', 'Use recommended eslintrc file')
105103
.option('-p, --pbiviz-file <pbiviz-file>', "Path to pbiviz.json file (useful for debugging)", pbivizFile)
106104
.addOption(new Option('-c, --compression <compressionLevel>', "Enables compression of visual package")
107105
.choices(['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'])

eslint.config.mjs

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import typescriptEslint from "@typescript-eslint/eslint-plugin";
2+
import globals from "globals";
3+
import tsParser from "@typescript-eslint/parser";
4+
5+
export default [
6+
{
7+
files: ["*.ts", "*tsx"],
8+
ignores: [
9+
"node_modules/",
10+
"dist/",
11+
"templates/",
12+
"spec/*/**",
13+
"**/lib/",
14+
"bin/",
15+
"eslint.config.mjs",
16+
],
17+
plugins: {
18+
"@typescript-eslint": typescriptEslint,
19+
},
20+
languageOptions: {
21+
globals: {
22+
...globals.node,
23+
},
24+
parser: tsParser,
25+
ecmaVersion: 2023,
26+
sourceType: "module",
27+
parserOptions: {
28+
project: "tsconfig.json",
29+
tsconfigRootDir: ".",
30+
},
31+
},
32+
rules: {
33+
"no-unused-vars": "off",
34+
"@typescript-eslint/no-unused-vars": "error",
35+
},
36+
}
37+
];

0 commit comments

Comments
 (0)