Skip to content

Commit

Permalink
update eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
carocao-msft committed Sep 27, 2024
1 parent 49c3e83 commit 3522ffb
Show file tree
Hide file tree
Showing 26 changed files with 1,108 additions and 947 deletions.
888 changes: 474 additions & 414 deletions common/config/rush/pnpm-lock.yaml

Large diffs are not rendered by default.

888 changes: 476 additions & 412 deletions common/config/rush/variants/stable/pnpm-lock.yaml

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,13 @@
},
"bugs": {
"url": "https://github.com/Azure/communication-ui-library/issues/new/choose"
},
"dependencies": {
"globals": "^15.9.0"
},
"devDependencies": {
"@eslint/eslintrc": "^3.1.0",
"@eslint/js": "^9.11.1",
"eslint-plugin-jsdoc": "^50.3.0"
}
}
6 changes: 0 additions & 6 deletions packages/acs-ui-common/.eslintignore

This file was deleted.

86 changes: 0 additions & 86 deletions packages/acs-ui-common/.eslintrc.js

This file was deleted.

121 changes: 121 additions & 0 deletions packages/acs-ui-common/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
import typescriptEslint from '@typescript-eslint/eslint-plugin';
import header from 'eslint-plugin-header';
import jsdoc from 'eslint-plugin-jsdoc';
import globals from 'globals';
import tsParser from '@typescript-eslint/parser';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import js from '@eslint/js';
import { FlatCompat } from '@eslint/eslintrc';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all
});

export default [
{
ignores: ['**/docs/', '**/public/', '**/dist/', '**/node_modules/', '**/scripts/', '**/preprocessed/']
},
...compat.extends('eslint:recommended', 'plugin:@typescript-eslint/recommended', 'plugin:prettier/recommended'),
{
plugins: {
'@typescript-eslint': typescriptEslint,
header,
jsdoc
},

languageOptions: {
globals: {
...globals.browser,
...globals.node
},

parser: tsParser,
ecmaVersion: 2020,
sourceType: 'module',

parserOptions: {
ecmaFeatures: {
jsx: true
}
}
},

settings: {
jsdoc: {
ignorePrivate: true
}
},
rules: {
'@typescript-eslint/explicit-function-return-type': [
'warn',
{
allowExpressions: true,
allowTypedFunctionExpressions: true
}
],

'@typescript-eslint/no-explicit-any': 'error',
eqeqeq: 'warn',

'@typescript-eslint/no-unused-vars': [
'warn',
{
varsIgnorePattern: '^_'
}
],

'no-restricted-imports': [
'error',
{
patterns: ['**/../**/src/*', '**/dist/**/es/*', '**/lib/**/es/*']
}
],

'jsdoc/require-jsdoc': [
'error',
{
checkConstructors: false,
enableFixer: false,
publicOnly: true,

require: {
ArrowFunctionExpression: true,
ClassDeclaration: true,
FunctionDeclaration: true
},

contexts: [
'ArrowFunctionExpression',
'FunctionDeclaration',
'FunctionExpression',
'TSDeclareFunction',
'TSEnumDeclaration',
'TSInterfaceDeclaration',
'TSTypeAliasDeclaration',
'VariableDeclaration'
]
}
],

curly: 'error'
}
},
{
files: ['**/*.test.ts', '**/*.test.tsx', '**/*.spec.ts', '**/*.spec.tsx', '**/mocks/*'],

languageOptions: {
globals: {
...globals.jest
}
},

rules: {
'@typescript-eslint/ban-ts-comment': 'off'
}
}
];
4 changes: 2 additions & 2 deletions packages/acs-ui-common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-header": "^3.1.0",
"eslint-plugin-import": "^2.29.0",
"eslint-plugin-jsdoc": "^36.1.0",
"eslint-plugin-jsdoc": "50.3.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint": "^8.57.0",
"eslint": "^9.11.1",
"if-env": "^1.0.4",
"jest": "29.7.0",
"prettier": "3.3.2",
Expand Down
4 changes: 2 additions & 2 deletions packages/acs-ui-javascript-loaders/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-header": "^3.1.0",
"eslint-plugin-import": "^2.29.0",
"eslint-plugin-jsdoc": "^36.1.0",
"eslint-plugin-jsdoc": "50.3.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint": "^8.57.0",
"eslint": "^9.11.1",
"if-env": "^1.0.4",
"jest": "29.7.0",
"prettier": "3.3.2",
Expand Down
4 changes: 2 additions & 2 deletions packages/calling-component-bindings/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-header": "^3.1.0",
"eslint-plugin-import": "^2.29.0",
"eslint-plugin-jsdoc": "^36.1.0",
"eslint-plugin-jsdoc": "50.3.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint": "^8.57.0",
"eslint": "^9.11.1",
"if-env": "^1.0.4",
"jest": "29.7.0",
"prettier": "3.3.2",
Expand Down
4 changes: 2 additions & 2 deletions packages/calling-stateful-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-header": "^3.1.0",
"eslint-plugin-import": "^2.29.0",
"eslint-plugin-jsdoc": "^36.1.0",
"eslint-plugin-jsdoc": "50.3.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint": "^8.57.0",
"eslint": "^9.11.1",
"if-env": "^1.0.4",
"jest": "29.7.0",
"prettier": "3.3.2",
Expand Down
4 changes: 2 additions & 2 deletions packages/chat-component-bindings/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-header": "^3.1.0",
"eslint-plugin-import": "^2.29.0",
"eslint-plugin-jsdoc": "^36.1.0",
"eslint-plugin-jsdoc": "50.3.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint": "^8.57.0",
"eslint": "^9.11.1",
"if-env": "^1.0.4",
"jest": "29.7.0",
"prettier": "3.3.2",
Expand Down
4 changes: 2 additions & 2 deletions packages/chat-stateful-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-header": "^3.1.0",
"eslint-plugin-import": "^2.29.0",
"eslint-plugin-jsdoc": "^36.1.0",
"eslint-plugin-jsdoc": "50.3.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint": "^8.57.0",
"eslint": "^9.11.1",
"if-env": "^1.0.4",
"jest": "29.7.0",
"prettier": "3.3.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/communication-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-react": "^7.34.3",
"eslint": "^8.57.0",
"eslint": "^9.11.1",
"if-env": "^1.0.4",
"jest": "29.7.0",
"json-stringify-safe": "^5.0.1",
Expand Down
4 changes: 2 additions & 2 deletions packages/fake-backends/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-header": "^3.1.0",
"eslint-plugin-import": "^2.29.0",
"eslint-plugin-jsdoc": "^36.1.0",
"eslint-plugin-jsdoc": "50.3.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint": "^8.57.0",
"eslint": "^9.11.1",
"if-env": "^1.0.4",
"jest": "29.7.0",
"prettier": "3.3.2",
Expand Down
4 changes: 2 additions & 2 deletions packages/react-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,12 @@
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-header": "^3.1.0",
"eslint-plugin-import": "^2.29.0",
"eslint-plugin-jsdoc": "^36.1.0",
"eslint-plugin-jsdoc": "50.3.0",
"eslint-plugin-jsx-a11y": "^6.8.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-react": "^7.34.3",
"eslint": "^8.57.0",
"eslint": "^9.11.1",
"husky": "^8.0.3",
"if-env": "^1.0.4",
"jest-environment-jsdom": "^29.5.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/react-composites/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,12 @@
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-header": "^3.1.0",
"eslint-plugin-import": "^2.29.0",
"eslint-plugin-jsdoc": "^36.1.0",
"eslint-plugin-jsdoc": "50.3.0",
"eslint-plugin-jsx-a11y": "^6.8.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-react": "^7.34.3",
"eslint": "^8.57.0",
"eslint": "^9.11.1",
"express": "^4.18.2",
"fs-extra": "^10.1.0",
"html-webpack-plugin": "^5.3.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/storybook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-react": "^7.34.3",
"eslint": "^8.57.0",
"eslint": "^9.11.1",
"husky": "^8.0.3",
"jest-fetch-mock": "^3.0.3",
"jest-junit": "^16.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/storybook8/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-react": "^7.34.3",
"eslint": "^8.57.0",
"eslint": "^9.11.1",
"husky": "^8.0.3",
"jest-fetch-mock": "^3.0.3",
"jest-junit": "^16.0.0",
Expand Down
2 changes: 1 addition & 1 deletion samples/CallWithChat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"cross-env": "^7.0.3",
"css-loader": "^4.3.0",
"env-cmd": "^10.1.0",
"eslint": "^8.57.0",
"eslint": "^9.11.1",
"eslint-config-prettier": "^9.1.0",
"eslint-config-react-app": "^6.0.0",
"eslint-plugin-flowtype": "^8.0.3",
Expand Down
2 changes: 1 addition & 1 deletion samples/Calling/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-react": "^7.34.3",
"eslint": "^8.57.0",
"eslint": "^9.11.1",
"html-webpack-plugin": "^5.3.1",
"husky": "^8.0.3",
"if-env": "^1.0.4",
Expand Down
2 changes: 1 addition & 1 deletion samples/CallingStateful/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-react": "^7.34.3",
"eslint": "^8.57.0",
"eslint": "^9.11.1",
"html-webpack-plugin": "^5.3.1",
"husky": "^8.0.3",
"if-env": "^1.0.4",
Expand Down
Loading

0 comments on commit 3522ffb

Please sign in to comment.