mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-12-13 15:58:50 +00:00
Merge commit 'e8270e2807727e1cf6a47a40442b3038c5bca858' into glitch-soc/merge-upstream
Conflicts: - `.eslintrc.js`: Upstream moved it to `eslint.config.mjs`. Ported the glitch-soc changes there. - `yarn.lock`: Upstream updated dependencies close to glitch-soc-only dependencies. Ported upstream's changes.
This commit is contained in:
@@ -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'],
|
||||
},
|
||||
});
|
||||
45
streaming/eslint.config.mjs
Normal file
45
streaming/eslint.config.mjs
Normal file
@@ -0,0 +1,45 @@
|
||||
// @ts-check
|
||||
|
||||
import globals from 'globals';
|
||||
import tseslint from 'typescript-eslint';
|
||||
|
||||
// eslint-disable-next-line import/no-relative-packages -- Must import from the root
|
||||
import { baseConfig } from '../eslint.config.mjs';
|
||||
|
||||
export default tseslint.config([
|
||||
baseConfig,
|
||||
{
|
||||
languageOptions: {
|
||||
globals: globals.node,
|
||||
|
||||
parser: tseslint.parser,
|
||||
ecmaVersion: 2021,
|
||||
sourceType: 'module',
|
||||
},
|
||||
|
||||
settings: {
|
||||
'import/ignore': ['node_modules', '\\.(json)$'],
|
||||
'import/resolver': {
|
||||
typescript: {},
|
||||
},
|
||||
},
|
||||
|
||||
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',
|
||||
|
||||
'import/no-extraneous-dependencies': [
|
||||
'error',
|
||||
{
|
||||
devDependencies: ['**/*.config.mjs'],
|
||||
},
|
||||
],
|
||||
|
||||
'import/extensions': ['error', 'always'],
|
||||
},
|
||||
},
|
||||
]);
|
||||
7
streaming/lint-staged.config.mjs
Normal file
7
streaming/lint-staged.config.mjs
Normal file
@@ -0,0 +1,7 @@
|
||||
const config = {
|
||||
'*': 'prettier --ignore-unknown --write',
|
||||
'*.{js,ts}': 'eslint --fix',
|
||||
'**/*.ts': () => 'tsc -p tsconfig.json --noEmit',
|
||||
};
|
||||
|
||||
export default config;
|
||||
@@ -31,14 +31,16 @@
|
||||
"ws": "^8.12.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^9.23.0",
|
||||
"@types/cors": "^2.8.16",
|
||||
"@types/express": "^4.17.17",
|
||||
"@types/pg": "^8.6.6",
|
||||
"@types/uuid": "^10.0.0",
|
||||
"@types/ws": "^8.5.9",
|
||||
"eslint-define-config": "^2.0.0",
|
||||
"globals": "^16.0.0",
|
||||
"pino-pretty": "^13.0.0",
|
||||
"typescript": "^5.0.4"
|
||||
"typescript": "^5.0.4",
|
||||
"typescript-eslint": "^8.28.0"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"bufferutil": "^4.0.7",
|
||||
|
||||
@@ -8,5 +8,5 @@
|
||||
"tsBuildInfoFile": "../tmp/cache/streaming/tsconfig.tsbuildinfo",
|
||||
"paths": {}
|
||||
},
|
||||
"include": ["./*.js", "./.eslintrc.cjs"]
|
||||
"include": ["./*.js"]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user