Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions .eslintrc.cjs

This file was deleted.

21 changes: 0 additions & 21 deletions .eslintrc.dist.cjs

This file was deleted.

2 changes: 1 addition & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"semi": true,
"tabWidth": 2,
"printWidth": 100,
"importOrder": ["<THIRD_PARTY_MODULES>", "^[./]"],
"importOrder": ["<THIRD_PARTY_TS_TYPES>", "^[./]"],
"importOrderSeparation": false,
"importOrderSortSpecifiers": true,
"importOrderParserPlugins": ["typescript"],
Expand Down
12 changes: 12 additions & 0 deletions eslint.config.dist.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// @ts-check
import compat from 'eslint-plugin-compat';

const compatPlugin = compat.configs['flat/recommended'];

compatPlugin.settings = { ...compatPlugin.settings, lintAllEsApis: true };

if (compatPlugin.rules) {
compatPlugin.rules['compat/compat'] = 'warn'; // TODO once we've updated browser support and use feature detection that this plugin can understand we can change this to 'error'
}

export default [compatPlugin];
171 changes: 171 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
// @ts-check
import js from '@eslint/js';
import { configs, plugins, rules } from 'eslint-config-airbnb-extended';
import { rules as prettierConfigRules } from 'eslint-config-prettier';
import prettierPlugin from 'eslint-plugin-prettier';

const strictness = 'off';

const jsConfig = [
// ESLint Recommended Rules
{
name: 'js/config',
...js.configs.recommended,
},
// Stylistic Plugin
plugins.stylistic,
// Import X Plugin
plugins.importX,
// Airbnb Base Recommended Config
...configs.base.recommended,
// Strict Import Config
rules.base.importsStrict,
];

const typescriptConfig = [
// TypeScript ESLint Plugin
plugins.typescriptEslint,
// Airbnb Base TypeScript Config
...configs.base.typescript,
// Strict TypeScript Config
rules.typescript.typescriptEslintStrict,
];

const prettierConfig = [
// Prettier Plugin
{
name: 'prettier/plugin/config',
plugins: {
prettier: prettierPlugin,
},
},
// Prettier Config
{
name: 'prettier/config',
rules: {
...prettierConfigRules,
'prettier/prettier': 'error',
},
},
];

export default [
// Javascript Config
...jsConfig,
// TypeScript Config
...typescriptConfig,
// Prettier Config
...prettierConfig,
{
languageOptions: {
parserOptions: {
projectService: false,
project: './tsconfig.eslint.json',
},
},
rules: {
'import/export': 'off',
'max-classes-per-file': 'off',
'no-param-reassign': 'off',
'no-await-in-loop': 'off',
'no-restricted-syntax': 'off',
'consistent-return': 'off',
'class-methods-use-this': 'off',
'no-underscore-dangle': 'off',

// compat rules to make lint temporarily pass after upgrading to eslint v9 and airbnb-config-extended
// these can then get removed one by one to allow for small and focused PRs
'import-x/prefer-default-export': strictness,
'import-x/order': strictness,
'import-x/consistent-type-specifier-style': strictness,
'import-x/no-cycle': strictness,
'import-x/no-extraneous-dependencies': strictness,
'import-x/export': strictness,
'import-x/no-namespace': strictness,

'@typescript-eslint/no-use-before-define': strictness,
'@typescript-eslint/consistent-type-definitions': strictness,
'@typescript-eslint/explicit-module-boundary-types': strictness,
'@typescript-eslint/no-explicit-any': strictness,
'@typescript-eslint/ban-ts-comment': strictness,
'@typescript-eslint/no-wrapper-object-types': strictness,
'@typescript-eslint/consistent-type-imports': strictness,
'@typescript-eslint/method-signature-style': strictness,
'@typescript-eslint/unified-signatures': strictness,
'@typescript-eslint/no-unsafe-return': strictness,
'@typescript-eslint/await-thenable': strictness,
'@typescript-eslint/prefer-regexp-exec': strictness,
'@typescript-eslint/no-confusing-void-expression': strictness,
'@typescript-eslint/no-empty-object-type': strictness,
'@typescript-eslint/no-import-type-side-effects': strictness,
'@typescript-eslint/no-invalid-void-type': strictness,
'@typescript-eslint/no-namespace': strictness,
'@typescript-eslint/prefer-destructuring': strictness,
'@typescript-eslint/consistent-type-assertions': strictness,
'@typescript-eslint/no-unnecessary-type-assertion': strictness,
'@typescript-eslint/no-non-null-assertion': strictness,
'@typescript-eslint/prefer-optional-chain': strictness,
'@typescript-eslint/prefer-for-of': strictness,
'@typescript-eslint/no-duplicate-type-constituents': strictness,
'@typescript-eslint/consistent-indexed-object-style': strictness,
'@typescript-eslint/no-unnecessary-boolean-literal-compare': strictness,
'@typescript-eslint/class-literal-property-style': strictness,
'@typescript-eslint/consistent-generic-constructors': strictness,
'@typescript-eslint/promise-function-async': strictness,
'@typescript-eslint/no-unsafe-enum-comparison': strictness,
'@typescript-eslint/no-redundant-type-constituents': strictness,
'@typescript-eslint/prefer-reduce-type-parameter': strictness,
'@typescript-eslint/no-unused-vars': strictness,
'@typescript-eslint/prefer-includes': strictness,
'@typescript-eslint/no-misused-spread': strictness,
'@typescript-eslint/consistent-type-exports': strictness,
'@typescript-eslint/prefer-function-type': strictness,
'@typescript-eslint/prefer-find': strictness,

'@stylistic/spaced-comment': strictness,

'no-self-assign': strictness,
'no-plusplus': strictness,
'no-bitwise': strictness,
'no-else-return': strictness,
'no-nested-ternary': strictness,
'no-promise-executor-return': strictness,
'prefer-const': strictness,
'prefer-exponentiation-operator': strictness,
'no-async-promise-executor': strictness,
'no-console': strictness,
'no-restricted-properties': strictness,
'no-undef-init': strictness,
'no-irregular-whitespace': strictness,
'object-shorthand': strictness,
'no-case-declarations': strictness,
'no-useless-escape': strictness,
'no-useless-catch': strictness,
'no-useless-return': strictness,
'no-return-assign': strictness,
'no-fallthrough': strictness,
'default-case': strictness,
'operator-assignment': strictness,
'prefer-promise-reject-errors': strictness,
'no-continue': strictness,
'arrow-body-style': strictness,
'no-new': strictness,
'vars-on-top': strictness,
'no-var': strictness,
'no-restricted-globals': strictness,
'no-lonely-if': strictness,
'no-empty': strictness,
'one-var': strictness,
'no-multi-assign': strictness,
'new-cap': strictness,

radix: strictness,
eqeqeq: strictness,

// debatable
'@typescript-eslint/array-type': 'off',
'@typescript-eslint/no-inferrable-types': 'off',
'@typescript-eslint/prefer-nullish-coalescing': 'off',
},
},
];
2 changes: 1 addition & 1 deletion examples/rpc/api.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import dotenv from 'dotenv';
import express from 'express';
import type { Express } from 'express';
import { AccessToken } from 'livekit-server-sdk';
import type { Express } from 'express';

dotenv.config({ path: '.env.local' });

Expand Down
14 changes: 9 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"format:check": "prettier --check src examples/**/*.ts",
"ci:publish": "pnpm build:clean && pnpm compat && changeset publish",
"downlevel-dts": "downlevel-dts ./dist/src ./dist/ts4.2 --to=4.2",
"compat": "eslint --no-eslintrc --config ./.eslintrc.dist.cjs ./dist/livekit-client.umd.js",
"compat": "eslint --config ./eslint.config.dist.mjs --no-inline-config ./dist/livekit-client.esm.mjs",
"size-limit": "size-limit"
},
"dependencies": {
Expand All @@ -74,6 +74,7 @@
"@babel/preset-env": "7.28.5",
"@bufbuild/protoc-gen-es": "^1.10.0",
"@changesets/cli": "2.29.7",
"@eslint/js": "9.39.1",
"@livekit/changesets-changelog-github": "^0.0.4",
"@rollup/plugin-babel": "6.1.0",
"@rollup/plugin-commonjs": "28.0.9",
Expand All @@ -82,18 +83,20 @@
"@rollup/plugin-terser": "^0.4.4",
"@size-limit/file": "^11.2.0",
"@size-limit/webpack": "^11.2.0",
"@stylistic/eslint-plugin": "^3.1.0",
"@trivago/prettier-plugin-sort-imports": "^5.0.0",
"@types/events": "^3.0.3",
"@types/sdp-transform": "2.15.0",
"@types/ua-parser-js": "0.7.39",
"@typescript-eslint/eslint-plugin": "7.18.0",
"@typescript-eslint/parser": "7.18.0",
"downlevel-dts": "^0.11.0",
"eslint": "8.57.1",
"eslint-config-airbnb-typescript": "18.0.0",
"eslint": "9.39.1",
"eslint-config-airbnb-extended": "^2.3.2",
"eslint-config-prettier": "10.1.8",
"eslint-plugin-ecmascript-compat": "^3.2.1",
"eslint-plugin-import": "2.32.0",
"eslint-plugin-compat": "^6.0.2",
"eslint-plugin-import-x": "^4.16.1",
"eslint-plugin-prettier": "^5.5.4",
"gh-pages": "6.3.0",
"happy-dom": "^17.2.0",
"jsdom": "^26.1.0",
Expand All @@ -105,6 +108,7 @@
"typedoc": "0.28.14",
"typedoc-plugin-no-inherit": "1.6.1",
"typescript": "5.8.3",
"typescript-eslint": "^8.47.0",
"vite": "7.2.2",
"vitest": "^3.0.0"
},
Expand Down
Loading
Loading