Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lint upgrade and remove TypeScript for @finos/perspective-jupyterlab #1537

Merged
merged 4 commits into from
Sep 12, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Upgrade eslint and remove custom rules
  • Loading branch information
texodus committed Sep 12, 2021
commit c20e7c15b9c021a8a69c2f3f01dc2f4b2b28b956
24 changes: 2 additions & 22 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,7 @@

}
}, {
"files": ["**/test/**/*.js"],
"rules": {
"max-len": ["warn", {
"code": 200,
"comments": 200,
"ignoreTrailingComments": true
}]
}
"files": ["**/test/**/*.js"]
}, {
"files": ["**/*.md"],
"rules": {
Expand All @@ -54,24 +47,11 @@
}],
"rules": {
"prettier/prettier": ["error", {
"printWidth": 200,
"tabWidth": 4,
"bracketSpacing": false
}],
"max-len": ["warn", {
"code": 200,
"comments": 80,
"ignoreTrailingComments": true
}],
"@typescript-eslint/camelcase": "off",
"linebreak-style": ["error","unix"],
"camelcase": "off",
"no-const-assign": "error",
"no-this-before-super": "error",
"no-undef": "error",
"no-unreachable": "error",
"no-unused-vars": "error",
"constructor-super": "error",
"valid-typeof": "error"
"camelcase": "off"
}
}
18 changes: 8 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
"@rollup/plugin-node-resolve": "^11.1.1",
"@rollup/plugin-typescript": "^8.2.5",
"@types/ws": "^7.2.2",
"@typescript-eslint/eslint-plugin": "^2.4.0",
"@typescript-eslint/parser": "^2.4.0",
"@typescript-eslint/eslint-plugin": "^4.31.0",
"@typescript-eslint/parser": "^4.31.0",
"arraybuffer-loader": "^1.0.2",
"babel-eslint": "^10.0.3",
"babel-jest": "^25.1.0",
Expand All @@ -49,10 +49,10 @@
"cssnano": "^4.1.10",
"cssnano-preset-lite": "^1.0.1",
"dotenv": "^8.1.0",
"eslint": "^6.6.0",
"eslint-config-prettier": "^3.0.1",
"eslint-plugin-markdown": "^1.0.2",
"eslint-plugin-prettier": "^2.6.2",
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-markdown": "^2.2.0",
"eslint-plugin-prettier": "^4.0.0",
"file-loader": "^6.2.0",
"fs-extra": "^8.1.0",
"html-loader": "^0.5.1",
Expand All @@ -75,7 +75,7 @@
"postcss": "^8.2.6",
"postcss-loader": "^4.1.0",
"pre-commit": "^1.2.2",
"prettier": "^1.19.1",
"prettier": "^2.4.0",
"puppeteer": "^10.2.0",
"rimraf": "^2.6.2",
"rollup": "^2.38.5",
Expand Down Expand Up @@ -133,8 +133,7 @@
"start": "lerna run start --stream --scope",
"precommit": "npm run lint",
"lint": "npm-run-all lint:*",
"lint:eslint": "eslint \"packages/*/src/**/*.js\" \"packages/*/test/**/*.js\" \"examples/*/*.js\"",
"lint:typescript": "eslint \"packages/perspective-jupyterlab/src/ts/*.ts\"",
"lint:eslint": "eslint \"scripts/*.js\" \"rust/**/*.ts\" \"rust/**/*.js\" \"packages/**/*.js\" \"cpp/**/*.js\"",
"lint:python": "node scripts/lint_python.js",
"fix:es": "npm run lint:eslint -- --fix",
"fix:md": "prettier docs/md/*.md --prose-wrap=always --write",
Expand All @@ -143,7 +142,6 @@
"fix:html": "html-beautify packages/**/src/html/*.html -r",
"fix:json": "prettier --tab-width 4 --write **/package.json",
"fix:python": "node scripts/lint_python.js --fix",
"fix:rust": "lerna run fix --scope=@finos/perspective-rust-internal",
"fix": "npm-run-all --silent fix:*",
"toggle_puppeteer": "node scripts/toggle_puppeteer.js",
"version": "python3 python/perspective/scripts/write_version.py && git add python/perspective/perspective/core/_version.py",
Expand Down
4 changes: 2 additions & 2 deletions rust/perspective-viewer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
"docs:build": "typedoc --hideBreadcrumbs --out dist/docs --readme none --excludePrivate src/ts/index.ts",
"docs:concat": "node ./concat-md.js",
"docs:deploy": "(echo \"---\nid: perspective\ntitle: perspective-viewer API\n---\n\n\"; cat README.md) > ../../docs/obj/perspective-viewer.md",
"fix": "yarn lint --fix",
"lint": "eslint src examples/*.md examples/*.html",
"fix": "yarn lint --fix && cargo fmt",
"lint": "eslint src/ts",
"test:build:rust": "cpx ../../packages/perspective/dist/umd/perspective.inline.js dist/pkg/",
"test:build:js": "cpx \"test/html/*\" dist/umd && cpx \"test/csv/*\" dist/umd && cpx \"test/css/*\" dist/umd",
"test:build": "npm-run-all test:build:*",
Expand Down
8 changes: 4 additions & 4 deletions rust/perspective-viewer/src/ts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import * as perspective from "@finos/perspective";
// There is no way to provide a default rejection handler within a promise and
// also not lock the await-er, so this module attaches a global handler to
// filter out cancelled query messages.
window.addEventListener("unhandledrejection", event => {
window.addEventListener("unhandledrejection", (event) => {
if (event.reason?.message === "View method cancelled") {
event.preventDefault();
}
Expand All @@ -56,7 +56,7 @@ const WASM_MODULE = import(
export type PerspectiveViewerConfig = perspective.ViewConfig & {
plugin?: string;
settings?: boolean;
plugin_config?: object;
plugin_config?: any;
};

/**
Expand Down Expand Up @@ -120,7 +120,7 @@ export class PerspectiveViewerElement extends HTMLElement {
* @param name The `name` of the custom element to register, as supplied
* to the `customElements.define(name)` method.
*/
static async registerPlugin(name): Promise<void> {
static async registerPlugin(name: string): Promise<void> {
const module = await WASM_MODULE;
module.register_plugin(name);
}
Expand Down Expand Up @@ -460,7 +460,7 @@ export class PerspectiveViewerElement extends HTMLElement {
* active plugin.
* @returns The active or requested plugin instance.
*/
async getPlugin(name): Promise<HTMLElement> {
async getPlugin(name?: string): Promise<HTMLElement> {
await this.load_wasm();
const plugin = await this.instance.js_get_plugin(name);
return plugin;
Expand Down
Loading