Skip to content

Commit

Permalink
Fixed eslint config
Browse files Browse the repository at this point in the history
  • Loading branch information
AleksSavelev committed Oct 3, 2024
1 parent a696fc0 commit b5e316d
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 27 deletions.
7 changes: 0 additions & 7 deletions .eslintignore

This file was deleted.

23 changes: 9 additions & 14 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,33 @@ import typescriptEslint from "@typescript-eslint/eslint-plugin";
import globals from "globals";
import tsParser from "@typescript-eslint/parser";

export default [
export default [
{
files: ["*.ts", "*tsx"],
ignores: [
"**/node_modules",
"**/dist",
"**/templates",
"**/spec",
"**/.eslintrc.json",
"**/lib",
"**/bin",
"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",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"test": "npm run build && npm run clean-tests && npm run lint && npm run jasmine",
"jasmine": "node spec/jasmine-runner.js",
"jasmine-inspect": "node --inspect spec/jasmine-runner.js",
"lint": "npx eslint . --ext .ts,.tsx",
"lint": "npx eslint .",
"clean-tests": "node spec/clean-tests.js",
"debug-tests": "npm run clean-tests && npm run lint && npm run jasmine-inspect"
},
Expand Down
2 changes: 1 addition & 1 deletion spec/e2e/pbivizPackageSpec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* eslint-disable no-useless-escape */
/*
* Power BI Visual CLI
*
Expand Down
4 changes: 2 additions & 2 deletions spec/e2e/pbivizWebpackVerSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ describe("E2E - webpack tools", () => {
const packageJson = fs.readJsonSync(path.join(visualPath, 'package.json'));
expect(packageJson.dependencies["powerbi-visuals-api"]).toBeDefined();
expect(semver.major(pbivizJson.apiVersion))
.toBe(semver.major(packageJson.dependencies["powerbi-visuals-api"].replace(/\^|\~/, ""))); // eslint-disable-line no-useless-escape
.toBe(semver.major(packageJson.dependencies["powerbi-visuals-api"].replace(/\^|\~/, "")));
expect(semver.minor(pbivizJson.apiVersion))
.toBe(semver.minor(packageJson.dependencies["powerbi-visuals-api"].replace(/\^|\~/, ""))); // eslint-disable-line no-useless-escape
.toBe(semver.minor(packageJson.dependencies["powerbi-visuals-api"].replace(/\^|\~/, "")));
});

it("Should skip powerbi-visual-api installation with flag --skip-api", () => {
Expand Down
2 changes: 1 addition & 1 deletion spec/helpers/FileSystem.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export default class FileSystem {
* @param {boolean} [verbose = false] - enables verbose output
*/
static runPbiviz(command, args, flags, verbose) {
let opts = verbose ? undefined : { stdio: [] }; // eslint-disable-line no-undefined
let opts = verbose ? undefined : { stdio: [] };

flags = flags ? ' ' + flags : '';
args = args ? ' ' + args : '';
Expand Down
2 changes: 1 addition & 1 deletion src/VisualGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ export default class VisualGenerator {
*/
static checkVisualName(name) {
const regexES3ReservedWord = /^(?:do|if|in|for|int|new|try|var|byte|case|char|else|enum|goto|long|null|this|true|void|with|break|catch|class|const|false|final|float|short|super|throw|while|delete|double|export|import|native|public|return|static|switch|throws|typeof|boolean|default|extends|finally|package|private|abstract|continue|debugger|function|volatile|interface|protected|transient|implements|instanceof|synchronized)$/;
const regexNumber = /^(?![+-])([0-9\+\-\.]+)/; // eslint-disable-line no-useless-escape
const regexNumber = /^(?![+-])([0-9\+\-\.]+)/;
const regexZeroWidth = /\u200c|\u200d/;
const regexpWrongSymbols = /^[a-zA-Z0-9]+$/;
const valueAsUnescapedString = name.replace(/\\u([a-fA-F0-9]{4})|\\u\{([0-9a-fA-F]{1,})\}/g, ($0, $1, $2) => {
Expand Down

0 comments on commit b5e316d

Please sign in to comment.