mirror of
https://github.com/mastodon/mastodon.git
synced 2024-12-22 18:45:41 +01:00
Hoist ESLint config in streaming
This commit is contained in:
parent
8dc7f8533d
commit
9bff4fbca3
4 changed files with 35 additions and 45 deletions
35
.eslintrc.js
35
.eslintrc.js
|
@ -362,6 +362,41 @@ module.exports = defineConfig({
|
|||
env: {
|
||||
jest: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ['streaming/*.js'],
|
||||
env: {
|
||||
browser: false,
|
||||
},
|
||||
parserOptions: {
|
||||
project: true,
|
||||
tsconfigRootDir: 'streaming/',
|
||||
ecmaFeatures: {
|
||||
jsx: false,
|
||||
},
|
||||
ecmaVersion: 2021,
|
||||
},
|
||||
rules: {
|
||||
// In the streaming server we need to delete some variables to ensure
|
||||
// garbage collection takes place on the values referenced by those objects;
|
||||
// The alternative is to declare the variable as nullable, but then we need
|
||||
// to assert it's in existence before every use, which becomes much harder
|
||||
// to maintain.
|
||||
'no-delete-var': 'off',
|
||||
|
||||
// This overrides the base configuration for this rule to pick up
|
||||
// dependencies for the streaming server from the correct package.json file.
|
||||
'import/no-extraneous-dependencies': [
|
||||
'error',
|
||||
{
|
||||
optionalDependencies: false,
|
||||
peerDependencies: false,
|
||||
includeTypes: true,
|
||||
packageDir: 'streaming',
|
||||
},
|
||||
],
|
||||
'import/extensions': ['error', 'always'],
|
||||
},
|
||||
}
|
||||
],
|
||||
});
|
||||
|
|
|
@ -1,43 +0,0 @@
|
|||
/* eslint-disable import/no-commonjs */
|
||||
|
||||
// @ts-check
|
||||
|
||||
// @ts-ignore - This needs to be a CJS file (eslint does not yet support ESM configs), and TS is complaining we use require
|
||||
const { defineConfig } = require('eslint-define-config');
|
||||
|
||||
module.exports = defineConfig({
|
||||
extends: ['../.eslintrc.js'],
|
||||
env: {
|
||||
browser: false,
|
||||
},
|
||||
parserOptions: {
|
||||
project: true,
|
||||
tsconfigRootDir: __dirname,
|
||||
ecmaFeatures: {
|
||||
jsx: false,
|
||||
},
|
||||
ecmaVersion: 2021,
|
||||
},
|
||||
rules: {
|
||||
// In the streaming server we need to delete some variables to ensure
|
||||
// garbage collection takes place on the values referenced by those objects;
|
||||
// The alternative is to declare the variable as nullable, but then we need
|
||||
// to assert it's in existence before every use, which becomes much harder
|
||||
// to maintain.
|
||||
'no-delete-var': 'off',
|
||||
|
||||
// This overrides the base configuration for this rule to pick up
|
||||
// dependencies for the streaming server from the correct package.json file.
|
||||
'import/no-extraneous-dependencies': [
|
||||
'error',
|
||||
{
|
||||
devDependencies: ['streaming/.eslintrc.cjs'],
|
||||
optionalDependencies: false,
|
||||
peerDependencies: false,
|
||||
includeTypes: true,
|
||||
packageDir: __dirname,
|
||||
},
|
||||
],
|
||||
'import/extensions': ['error', 'always'],
|
||||
},
|
||||
});
|
|
@ -36,7 +36,6 @@
|
|||
"@types/pg": "^8.6.6",
|
||||
"@types/uuid": "^10.0.0",
|
||||
"@types/ws": "^8.5.9",
|
||||
"eslint-define-config": "^2.0.0",
|
||||
"pino-pretty": "^11.0.0",
|
||||
"typescript": "^5.0.4"
|
||||
},
|
||||
|
|
|
@ -2996,7 +2996,6 @@ __metadata:
|
|||
bufferutil: "npm:^4.0.7"
|
||||
cors: "npm:^2.8.5"
|
||||
dotenv: "npm:^16.0.3"
|
||||
eslint-define-config: "npm:^2.0.0"
|
||||
express: "npm:^4.18.2"
|
||||
ioredis: "npm:^5.3.2"
|
||||
jsdom: "npm:^25.0.0"
|
||||
|
|
Loading…
Reference in a new issue