Skip to content

Commit

Permalink
Migrate eslinrc.json to eslint.config.mjs
Browse files Browse the repository at this point in the history
  • Loading branch information
rocketstack-matt committed Oct 28, 2024
1 parent 4895f6d commit 320659a
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 58 deletions.
38 changes: 0 additions & 38 deletions cli/.eslintrc.json

This file was deleted.

41 changes: 41 additions & 0 deletions cli/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import typescriptEslint from "@typescript-eslint/eslint-plugin";
import globals from "globals";
import tsParser from "@typescript-eslint/parser";
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 [
...compat.extends("eslint:recommended", "plugin:@typescript-eslint/recommended"),
{
plugins: {
"@typescript-eslint": typescriptEslint,
},

languageOptions: {
globals: {
...globals.browser,
},

parser: tsParser,
ecmaVersion: "latest",
sourceType: "module",
},

rules: {
indent: ["error", 4],
"linebreak-style": ["error", "unix"],
quotes: ["error", "single"],
semi: ["error", "always"],
},
},
];
35 changes: 19 additions & 16 deletions cli/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 cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
"winston": "^3.14.1"
},
"devDependencies": {
"@eslint/eslintrc": "^3.1.0",
"@eslint/js": "^9.13.0",
"@jest/globals": "^29.7.0",
"@types/jest": "^29.5.12",
"@types/js-yaml": "^4.0.9",
Expand All @@ -56,6 +58,7 @@
"eslint-plugin-n": "^17.11.1",
"eslint-plugin-promise": "^7.1.0",
"fetch-mock": "^9.11.0",
"globals": "^15.11.0",
"jest": "^29.7.0",
"ts-jest": "^29.1.2",
"ts-node": "^10.9.2",
Expand Down
2 changes: 0 additions & 2 deletions cli/src/commands/generate/components/property.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable @typescript-eslint/no-explicit-any */

import { getPropertyValue } from './property';

jest.mock('../../helper', () => {
Expand Down
2 changes: 0 additions & 2 deletions cli/src/commands/generate/schema-directory.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable @typescript-eslint/no-explicit-any */

import { readdir, readFile } from 'fs/promises';
import { join } from 'path';
import pointer from 'json-pointer';
Expand Down

0 comments on commit 320659a

Please sign in to comment.