You've already forked factorio-blueprint-editor
mirror of
https://github.com/teoxoy/factorio-blueprint-editor.git
synced 2025-11-23 22:15:01 +02:00
update eslint and simplify its config
This commit is contained in:
@@ -1,54 +0,0 @@
|
|||||||
rules:
|
|
||||||
# Best Practices (https://eslint.org/docs/rules/#best-practices)
|
|
||||||
curly: [warn, all]
|
|
||||||
dot-notation: [error, allowPattern: '^[a-z]+(_[a-z]+)+$']
|
|
||||||
eqeqeq: [warn, always]
|
|
||||||
guard-for-in: error
|
|
||||||
no-new-func: error
|
|
||||||
no-new-wrappers: error
|
|
||||||
no-param-reassign: error
|
|
||||||
no-return-assign: [warn, always]
|
|
||||||
no-return-await: error
|
|
||||||
no-self-compare: error
|
|
||||||
no-sequences: error
|
|
||||||
no-throw-literal: error
|
|
||||||
no-unmodified-loop-condition: error
|
|
||||||
no-unused-expressions: error
|
|
||||||
no-useless-concat: error
|
|
||||||
no-useless-return: error
|
|
||||||
no-void: error
|
|
||||||
no-with: error
|
|
||||||
wrap-iife: [error, inside]
|
|
||||||
yoda: [error, never, exceptRange: true]
|
|
||||||
|
|
||||||
# Stylistic Issues (https://eslint.org/docs/rules/#stylistic-issues)
|
|
||||||
func-style: [error, declaration, allowArrowFunctions: true]
|
|
||||||
no-mixed-operators:
|
|
||||||
- error
|
|
||||||
- groups:
|
|
||||||
- ['&', '|', '^', '~', '<<', '>>', '>>>']
|
|
||||||
- ['==', '!=', '===', '!==', '>', '>=', '<', '<=']
|
|
||||||
- ['&&', '||']
|
|
||||||
- [in, instanceof]
|
|
||||||
allowSamePrecedence: true
|
|
||||||
no-multi-assign: error
|
|
||||||
no-negated-condition: error
|
|
||||||
no-new-object: error
|
|
||||||
no-plusplus: [error, allowForLoopAfterthoughts: true]
|
|
||||||
no-unneeded-ternary: error
|
|
||||||
operator-assignment: [error, always]
|
|
||||||
prefer-object-spread: error
|
|
||||||
spaced-comment:
|
|
||||||
- warn
|
|
||||||
- always
|
|
||||||
- block:
|
|
||||||
balanced: true
|
|
||||||
|
|
||||||
# ECMAScript 6 (https://eslint.org/docs/rules/#ecmascript-6)
|
|
||||||
arrow-body-style: [error, as-needed]
|
|
||||||
no-confusing-arrow: [error, allowParens: true]
|
|
||||||
no-var: error
|
|
||||||
prefer-const: error
|
|
||||||
prefer-rest-params: error
|
|
||||||
prefer-spread: error
|
|
||||||
prefer-template: error
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
rules:
|
|
||||||
import/no-unresolved: error
|
|
||||||
import/named: error
|
|
||||||
# import/default: error
|
|
||||||
import/namespace: error
|
|
||||||
import/export: error
|
|
||||||
|
|
||||||
import/no-named-as-default: warn
|
|
||||||
# import/no-named-as-default-member: warn
|
|
||||||
import/no-duplicates: warn
|
|
||||||
import/first: warn
|
|
||||||
import/order:
|
|
||||||
- warn
|
|
||||||
- groups:
|
|
||||||
- builtin
|
|
||||||
- external
|
|
||||||
- internal
|
|
||||||
- unknown
|
|
||||||
- parent
|
|
||||||
- sibling
|
|
||||||
- index
|
|
||||||
newlines-between: never
|
|
||||||
import/no-useless-path-segments: error
|
|
||||||
import/no-self-import: error
|
|
||||||
import/no-absolute-path: error
|
|
||||||
import/no-commonjs: error
|
|
||||||
import/no-amd: error
|
|
||||||
import/no-extraneous-dependencies:
|
|
||||||
- error
|
|
||||||
- devDependencies: true
|
|
||||||
peerDependencies: false
|
|
||||||
optionalDependencies: false
|
|
||||||
|
|
||||||
import/exports-last: warn
|
|
||||||
# import/group-exports: warn
|
|
||||||
# import/no-default-export: error
|
|
||||||
import/no-mutable-exports: error
|
|
||||||
import/no-named-default: error
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
rules:
|
|
||||||
# TODO: maybe turn on
|
|
||||||
# '@typescript-eslint/naming-convention':
|
|
||||||
# - error
|
|
||||||
# - selector: default
|
|
||||||
# format: [camelCase]
|
|
||||||
# TODO: turn on
|
|
||||||
'@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
|
|
||||||
'@typescript-eslint/consistent-type-assertions':
|
|
||||||
- error
|
|
||||||
- assertionStyle: as
|
|
||||||
objectLiteralTypeAssertions: allow-as-parameter
|
|
||||||
'@typescript-eslint/explicit-member-accessibility': warn
|
|
||||||
'@typescript-eslint/explicit-function-return-type':
|
|
||||||
- warn
|
|
||||||
- allowExpressions: true
|
|
||||||
allowTypedFunctionExpressions: true
|
|
||||||
allowHigherOrderFunctions: true
|
|
||||||
'@typescript-eslint/member-ordering':
|
|
||||||
- warn
|
|
||||||
- default:
|
|
||||||
- signature
|
|
||||||
- static-field
|
|
||||||
- instance-field
|
|
||||||
- abstract-field
|
|
||||||
- constructor
|
|
||||||
- static-method
|
|
||||||
- instance-method
|
|
||||||
- abstract-method
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
root: true
|
|
||||||
env:
|
|
||||||
es6: true
|
|
||||||
node: true
|
|
||||||
browser: true
|
|
||||||
|
|
||||||
parser: '@typescript-eslint/parser'
|
|
||||||
parserOptions:
|
|
||||||
sourceType: module
|
|
||||||
project:
|
|
||||||
- packages/*/tsconfig.json
|
|
||||||
- packages/*/tools/tsconfig.json
|
|
||||||
|
|
||||||
plugins:
|
|
||||||
- '@typescript-eslint'
|
|
||||||
- import
|
|
||||||
|
|
||||||
settings:
|
|
||||||
import/extensions: [.ts]
|
|
||||||
import/parsers:
|
|
||||||
'@typescript-eslint/parser': [.ts]
|
|
||||||
import/resolver:
|
|
||||||
typescript:
|
|
||||||
project:
|
|
||||||
- packages/*/tsconfig.json
|
|
||||||
- packages/*/tools/tsconfig.json
|
|
||||||
import/internal-regex: ^@fbe/
|
|
||||||
|
|
||||||
extends:
|
|
||||||
- eslint:recommended
|
|
||||||
- .eslint.base.yml
|
|
||||||
# Turn off eslint rules that conflict with typescript-eslint
|
|
||||||
- plugin:@typescript-eslint/recommended
|
|
||||||
- .eslint.typescript.yml
|
|
||||||
# Turn off eslint rules that conflict with prettier
|
|
||||||
- prettier
|
|
||||||
- .eslint.import.yml
|
|
||||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,5 +1,5 @@
|
|||||||
node_modules
|
node_modules
|
||||||
dist
|
packages/website/dist
|
||||||
packages/website/tools/.fusebox
|
packages/website/tools/.fusebox
|
||||||
packages/exporter/data/*
|
packages/exporter/data/*
|
||||||
!packages/exporter/data/output
|
!packages/exporter/data/output
|
||||||
|
|||||||
21
eslint.config.mjs
Normal file
21
eslint.config.mjs
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
import eslint from '@eslint/js'
|
||||||
|
import tseslint from 'typescript-eslint'
|
||||||
|
|
||||||
|
export default tseslint.config(
|
||||||
|
eslint.configs.recommended,
|
||||||
|
tseslint.configs.recommended, // TODO: try strict & strictTypeChecked
|
||||||
|
{
|
||||||
|
rules: {
|
||||||
|
'@typescript-eslint/ban-ts-comment': 'off', // TODO: remove
|
||||||
|
'@typescript-eslint/no-explicit-any': 'off', // TODO: remove
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ignores: [
|
||||||
|
'packages/website/dist',
|
||||||
|
'packages/editor/src/basis',
|
||||||
|
'packages/exporter',
|
||||||
|
'functions/corsproxy.js',
|
||||||
|
],
|
||||||
|
}
|
||||||
|
)
|
||||||
1997
package-lock.json
generated
1997
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
15
package.json
15
package.json
@@ -8,19 +8,16 @@
|
|||||||
"start:website": "npm --workspace=@fbe/website run start",
|
"start:website": "npm --workspace=@fbe/website run start",
|
||||||
"start:exporter": "cd ./packages/exporter && cargo run --release",
|
"start:exporter": "cd ./packages/exporter && cargo run --release",
|
||||||
"build:website": "npm --workspace=@fbe/website run build",
|
"build:website": "npm --workspace=@fbe/website run build",
|
||||||
"lint": "eslint **/*.ts --config .eslintrc.yml --ignore-path .gitignore",
|
"lint": "eslint .",
|
||||||
"lint:fix": "eslint **/*.ts --fix --config .eslintrc.yml --ignore-path .gitignore",
|
"lint:fix": "eslint . --fix",
|
||||||
"format": "prettier . --check",
|
"format": "prettier . --check",
|
||||||
"format:fix": "prettier . --write"
|
"format:fix": "prettier . --write"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@typescript-eslint/eslint-plugin": "^5.7.0",
|
"@eslint/js": "^9.16.0",
|
||||||
"@typescript-eslint/parser": "^5.7.0",
|
"eslint": "^9.16.0",
|
||||||
"eslint": "^8.4.1",
|
|
||||||
"eslint-config-prettier": "^8.3.0",
|
|
||||||
"eslint-import-resolver-typescript": "^2.5.0",
|
|
||||||
"eslint-plugin-import": "^2.25.3",
|
|
||||||
"prettier": "^3.4.2",
|
"prettier": "^3.4.2",
|
||||||
"typescript": "^4.5.4"
|
"typescript": "^4.5.4",
|
||||||
|
"typescript-eslint": "^8.17.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -147,7 +147,6 @@ export class PaintBlueprintContainer extends PaintContainer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
||||||
protected redraw(): void {}
|
protected redraw(): void {}
|
||||||
|
|
||||||
public placeEntityContainer(): void {
|
public placeEntityContainer(): void {
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ export class PaintTileContainer extends PaintContainer {
|
|||||||
this.redraw()
|
this.redraw()
|
||||||
}
|
}
|
||||||
|
|
||||||
public rotate(ccw = false): void {
|
public rotate(): void {
|
||||||
const nD = FD.tiles[this.name].next_direction
|
const nD = FD.tiles[this.name].next_direction
|
||||||
if (nD) {
|
if (nD) {
|
||||||
this.name = nD
|
this.name = nD
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ export class PaintWireContainer extends PaintContainer {
|
|||||||
this.cursorBox?.destroy()
|
this.cursorBox?.destroy()
|
||||||
}
|
}
|
||||||
|
|
||||||
public rotate(ccw = false): void {
|
public rotate(): void {
|
||||||
if (!this.visible) return
|
if (!this.visible) return
|
||||||
|
|
||||||
// const cursor_position = this.getGridPosition()
|
// const cursor_position = this.getGridPosition()
|
||||||
|
|||||||
@@ -44,7 +44,6 @@ export class WireConnections extends EventEmitter {
|
|||||||
|
|
||||||
const addConnSide = (side: string): void => {
|
const addConnSide = (side: string): void => {
|
||||||
if (connections[side]) {
|
if (connections[side]) {
|
||||||
// eslint-disable-next-line guard-for-in
|
|
||||||
for (const color in connections[side]) {
|
for (const color in connections[side]) {
|
||||||
const conn = connections[side] as BPS.IConnSide
|
const conn = connections[side] as BPS.IConnSide
|
||||||
for (const data of conn[color]) {
|
for (const data of conn[color]) {
|
||||||
|
|||||||
@@ -50,8 +50,6 @@ export function loadData(str: string): void {
|
|||||||
|
|
||||||
export default FD
|
export default FD
|
||||||
|
|
||||||
/* eslint-disable import/group-exports */
|
|
||||||
|
|
||||||
export interface Color {
|
export interface Color {
|
||||||
r: number
|
r: number
|
||||||
g: number
|
g: number
|
||||||
|
|||||||
Reference in New Issue
Block a user