mirror of
https://github.com/teoxoy/factorio-blueprint-editor.git
synced 2024-11-21 17:06:30 +02:00
update eslint
remove deprecated 'interface-name-prefix' and 'camelcase' fix lint issues
This commit is contained in:
parent
87d4d95e6c
commit
e9625f7c71
@ -1,12 +1,11 @@
|
||||
rules:
|
||||
# TODO: maybe turn on
|
||||
# '@typescript-eslint/naming-convention':
|
||||
# - error
|
||||
# - selector: default
|
||||
# format: [camelCase]
|
||||
# TODO: turn on
|
||||
'@typescript-eslint/camelcase': off
|
||||
# TODO: maybe turn off
|
||||
'@typescript-eslint/interface-name-prefix': [error, always]
|
||||
# '@typescript-eslint/naming-conventions':
|
||||
# - error
|
||||
# - selector: default
|
||||
# format: [camelCase]
|
||||
'@typescript-eslint/ban-ts-comment': off
|
||||
'@typescript-eslint/no-useless-constructor': warn
|
||||
'@typescript-eslint/restrict-plus-operands': error
|
||||
'@typescript-eslint/no-use-before-define': off
|
||||
@ -20,7 +19,6 @@ rules:
|
||||
- allowExpressions: true
|
||||
allowTypedFunctionExpressions: true
|
||||
allowHigherOrderFunctions: true
|
||||
'@typescript-eslint/ban-ts-ignore': off
|
||||
'@typescript-eslint/member-ordering':
|
||||
- warn
|
||||
- default:
|
||||
|
@ -21,7 +21,7 @@ settings:
|
||||
'@typescript-eslint/parser': [.ts]
|
||||
import/resolver:
|
||||
typescript:
|
||||
directory:
|
||||
project:
|
||||
- packages/*/tsconfig.json
|
||||
- packages/*/tools/tsconfig.json
|
||||
import/internal-regex: ^@fbe/
|
||||
@ -30,7 +30,6 @@ extends:
|
||||
- eslint:recommended
|
||||
- .eslint.base.yml
|
||||
# Turn off eslint rules that conflict with typescript-eslint
|
||||
- plugin:@typescript-eslint/eslint-recommended
|
||||
- plugin:@typescript-eslint/recommended
|
||||
- .eslint.typescript.yml
|
||||
# Turn off eslint rules that conflict with prettier
|
||||
|
12
package.json
12
package.json
@ -16,13 +16,13 @@
|
||||
"format:fix": "prettier **/*.{js,ts,html,json,yml,md} --write --config .prettierrc.yml --ignore-path .gitignore"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@typescript-eslint/eslint-plugin": "^2.33.0",
|
||||
"@typescript-eslint/parser": "^2.33.0",
|
||||
"@typescript-eslint/eslint-plugin": "^4.9.1",
|
||||
"@typescript-eslint/parser": "^4.9.1",
|
||||
"concurrently": "^5.2.0",
|
||||
"eslint": "^6.8.0",
|
||||
"eslint-config-prettier": "^6.11.0",
|
||||
"eslint-import-resolver-typescript": "^2.0.0",
|
||||
"eslint-plugin-import": "^2.20.2",
|
||||
"eslint": "^7.15.0",
|
||||
"eslint-config-prettier": "^7.0.0",
|
||||
"eslint-import-resolver-typescript": "^2.3.0",
|
||||
"eslint-plugin-import": "^2.22.1",
|
||||
"prettier": "^2.0.5",
|
||||
"typescript": "^3.9.3"
|
||||
}
|
||||
|
@ -13,19 +13,16 @@ export class OptimizedContainer extends PIXI.Container {
|
||||
}
|
||||
|
||||
public updateTransform(): void {
|
||||
// @ts-ignore
|
||||
this.worldAlpha = this.alpha * this.parent.worldAlpha
|
||||
this.transform.updateTransform(this.parent.transform)
|
||||
|
||||
for (const c of this.children) {
|
||||
// @ts-ignore
|
||||
c.worldAlpha = c.alpha * c.parent.worldAlpha
|
||||
c.transform.updateTransform(c.parent.transform)
|
||||
}
|
||||
}
|
||||
|
||||
public render(renderer: PIXI.Renderer): void {
|
||||
// @ts-ignore
|
||||
const batchRenderer = renderer.plugins.batch as PIXI.AbstractBatchRenderer
|
||||
renderer.batch.setObjectRenderer(batchRenderer)
|
||||
|
||||
|
@ -82,7 +82,8 @@ export abstract class PaintContainer extends PIXI.Container {
|
||||
}
|
||||
|
||||
private readonly updateIconPos = (): void => {
|
||||
const position = G.app.renderer.plugins.interaction.mouse.global
|
||||
const im = G.app.renderer.plugins.interaction as PIXI.InteractionManager
|
||||
const position = im.mouse.global
|
||||
this.icon.position.set(position.x + 16, position.y + 16)
|
||||
}
|
||||
|
||||
|
@ -58,7 +58,7 @@ const keywords: Record<string, KeywordDefinition> = {
|
||||
schema: false,
|
||||
},
|
||||
objectWithItemNames: {
|
||||
validate: (data: object) => Object.keys(data).every(key => !!FD.items[key]),
|
||||
validate: (data: Record<string, number>) => Object.keys(data).every(key => !!FD.items[key]),
|
||||
errors: false,
|
||||
schema: false,
|
||||
},
|
||||
|
@ -51,7 +51,6 @@ export function loadData(str: string): void {
|
||||
export default FD
|
||||
|
||||
/* eslint-disable import/group-exports */
|
||||
/* eslint-disable @typescript-eslint/interface-name-prefix */
|
||||
|
||||
export interface Color {
|
||||
r: number
|
||||
|
@ -4,7 +4,7 @@ import Delaunator from 'delaunator'
|
||||
|
||||
const hashPoint = (p: IPoint): string => `${p.x},${p.y}`
|
||||
|
||||
const equalPoints = <T extends IPoint>(a: T) => (b: T) => a.x === b.x && a.y === b.y
|
||||
const equalPoints = <T extends IPoint>(a: T) => (b: T): boolean => a.x === b.x && a.y === b.y
|
||||
|
||||
/** Returns unique points from points array */
|
||||
const uniqPoints = <T extends IPoint>(list: T[]): T[] =>
|
||||
|
2
packages/editor/src/global.d.ts
vendored
2
packages/editor/src/global.d.ts
vendored
@ -1,5 +1,5 @@
|
||||
declare module '*.json' {
|
||||
const content: object
|
||||
const content: Record<string, unknown>
|
||||
export default content
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,4 @@
|
||||
/* eslint-disable import/group-exports */
|
||||
/* eslint-disable @typescript-eslint/interface-name-prefix */
|
||||
|
||||
export interface Color {
|
||||
r: number
|
||||
|
@ -1,5 +1,4 @@
|
||||
declare global {
|
||||
// eslint-disable-next-line @typescript-eslint/interface-name-prefix
|
||||
interface Window {
|
||||
doorbellOptions: {
|
||||
tags?: string
|
||||
|
Loading…
Reference in New Issue
Block a user