Skip to content

Commit

Permalink
Fix ESLint conflict bugs, remove weird patch.
Browse files Browse the repository at this point in the history
  • Loading branch information
retrixe committed Aug 26, 2023
1 parent d49f3e5 commit d03506a
Show file tree
Hide file tree
Showing 6 changed files with 117 additions and 154 deletions.
20 changes: 2 additions & 18 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,12 @@
// well....
if (require('eslint-config-standard-with-typescript/package.json').version === '36.1.0') {
console.log('Patching eslint-config-standard-with-typescript for TypeScript ESLint 6 support.')
const fs = require('fs')
const path = require('path')
const target = path.join(__dirname, 'node_modules', 'eslint-config-standard-with-typescript', 'lib', 'index.js')
const contents = fs.readFileSync(target, { encoding: 'utf8' }).split('\n')
.filter(line => !line.includes('restrict-plus-operands'))
.join('\n')
fs.writeFileSync(target, contents, { encoding: 'utf8' })
}

module.exports = {
root: true,
extends: [
'@react-native',
'plugin:react/recommended',
'standard-with-typescript',
'standard-react',
'standard-jsx'
'standard-jsx',
'plugin:prettier/recommended'
],
plugins: ['react', 'react-hooks', '@typescript-eslint'],
parser: '@typescript-eslint/parser',
Expand All @@ -33,11 +22,6 @@ module.exports = {
'@typescript-eslint/restrict-plus-operands': 'off',
'@typescript-eslint/no-dynamic-delete': 'off',
'@typescript-eslint/no-var-requires': 'off',
// Adjust to Prettier's presence. (Maybe we should do away with it later.)
'@typescript-eslint/space-before-function-paren': 'off',
'@typescript-eslint/member-delimiter-style': 'off',
'@typescript-eslint/indent': 'off',
'multiline-ternary': 'off',
// Bitwise operations are necessary in this project.
'no-bitwise': 'off'
}
Expand Down
115 changes: 54 additions & 61 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 1 addition & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"eslint": "^8.45.0",
"eslint-config-standard-jsx": "^11.0.0",
"eslint-config-standard-react": "^13.0.0",
"eslint-config-standard-with-typescript": "^36.1.0",
"eslint-config-standard-with-typescript": "^38.0.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-n": "^16.0.1",
"eslint-plugin-promise": "^6.1.1",
Expand All @@ -79,10 +79,6 @@
"@typescript-eslint/eslint-plugin": "^6.1.0",
"@typescript-eslint/parser": "^6.1.0",
"eslint-plugin-prettier": "^5.0.0"
},
"eslint-config-standard-with-typescript": {
"@typescript-eslint/eslint-plugin": "^6.1.0",
"@typescript-eslint/parser": "^6.1.0"
}
},
"jest": {
Expand Down
2 changes: 0 additions & 2 deletions src/minecraft/connection/javascript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,10 @@ export declare interface JavaScriptServerConnection {
((event: string, listener: Function) => this) // eslint-disable-line @typescript-eslint/ban-types
}

/* eslint-disable @typescript-eslint/brace-style */
export class JavaScriptServerConnection
extends events.EventEmitter
implements ServerConnection
{
/* eslint-enable @typescript-eslint/brace-style */
bufferedData: Buffer = Buffer.from([])
compressionThreshold = -1
compressionEnabled = false
Expand Down
2 changes: 0 additions & 2 deletions src/minecraft/connection/native.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,10 @@ export declare interface NativeServerConnection {
((event: string, listener: Function) => this) // eslint-disable-line @typescript-eslint/ban-types
}

/* eslint-disable @typescript-eslint/brace-style */
export class NativeServerConnection
extends events.EventEmitter
implements ServerConnection
{
/* eslint-enable @typescript-eslint/brace-style */
eventEmitter = new NativeEventEmitter(ConnectionModule)
state = ConnectionState.LOGIN
closed = false
Expand Down
Loading

0 comments on commit d03506a

Please sign in to comment.