Skip to content

Commit

Permalink
Fix eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
chicocvenancio committed Jul 9, 2024
1 parent bfad2d4 commit 75da140
Show file tree
Hide file tree
Showing 6 changed files with 4,436 additions and 5,550 deletions.
5 changes: 0 additions & 5 deletions .eslintignore

This file was deleted.

39 changes: 0 additions & 39 deletions .eslintrc.js

This file was deleted.

12 changes: 0 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,6 @@ jobs:
pip-3.8-
pip-
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Setup yarn cache
uses: actions/cache@v4
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
yarn-
- name: Install dependencies
run: python -m pip install -U jupyterlab~=3.6 check-manifest
- name: Build the extension
Expand Down
66 changes: 66 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
import typescriptEslint from "@typescript-eslint/eslint-plugin";
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 [{
ignores: ["**/node_modules", "**/dist", "**/coverage", "**/*.d.ts", "**/tests", "eslint.config.mjs", "**/.venv"],
}, ...compat.extends(
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended",
), {
plugins: {
"@typescript-eslint": typescriptEslint,
},

languageOptions: {
parser: tsParser,
ecmaVersion: 5,
sourceType: "module",

parserOptions: {
project: "tsconfig.json",
},
},

rules: {
"@typescript-eslint/naming-convention": ["error", {
selector: "interface",
format: ["PascalCase"],

custom: {
regex: "^I[A-Z]",
match: true,
},
}],

"@typescript-eslint/no-unused-vars": ["warn", {
args: "none",
}],

"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-namespace": "off",
"@typescript-eslint/no-use-before-define": "off",

"@typescript-eslint/quotes": ["error", "single", {
avoidEscape: true,
allowTemplateLiterals: false,
}],

curly: ["error", "all"],
eqeqeq: "error",
"prefer-arrow-callback": "error",
},
}];
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
"clean:lib": "rimraf lib tsconfig.tsbuildinfo",
"clean:labextension": "rimraf labpawspublic/labextension",
"clean:all": "jlpm run clean:lib && jlpm run clean:labextension",
"eslint": "eslint . --ext .ts,.tsx --fix",
"eslint:check": "eslint . --ext .ts,.tsx",
"eslint": "eslint --fix",
"eslint:check": "eslint ",
"install:extension": "jlpm run build",
"watch": "run-p watch:src watch:labextension",
"watch:src": "tsc -w",
Expand All @@ -53,8 +53,8 @@
},
"devDependencies": {
"@jupyterlab/builder": "^4.2.3",
"@typescript-eslint/eslint-plugin": "^4.8.1",
"@typescript-eslint/parser": "^4.8.1",
"@typescript-eslint/eslint-plugin": "^7.16.0",
"@typescript-eslint/parser": "^7.16.0",
"eslint": "^9.6.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
Expand All @@ -79,7 +79,7 @@
"jupyter-releaser": {
"hooks": {
"before-build-npm": [
"python -m pip install jupyterlab~=3.1",
"python -m pip install jupyterlab~=3.6",
"jlpm"
]
}
Expand Down
Loading

0 comments on commit 75da140

Please sign in to comment.