Skip to content
Closed
Show file tree
Hide file tree
Changes from 6 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
4 changes: 3 additions & 1 deletion apps/demos/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@
"eslint-plugin-no-only-tests": "catalog:",
"eslint-plugin-react": "7.37.5",
"eslint-plugin-react-hooks": "5.2.0",
"eslint-plugin-react-perf": "3.3.2",
"eslint-plugin-react-perf": "3.3.3",
"eslint-plugin-vue": "catalog:",
"express": "4.22.0",
"glob": "11.1.0",
"globals": "catalog:",
Expand All @@ -152,6 +153,7 @@
"testcafe": "3.7.2",
"testcafe-reporter-spec-time": "4.0.0",
"ts-node": "10.9.2",
"vue-eslint-parser": "catalog:",
"vue-tsc": "3.0.8"
},
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion e2e/bundlers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"@eslint/eslintrc": "catalog:",
"@stylistic/eslint-plugin": "catalog:",
"@typescript-eslint/parser": "catalog:",
"eslint-config-devextreme": "1.1.6",
"eslint-config-devextreme": "catalog:",
"eslint-plugin-i18n": "catalog:",
"eslint-plugin-import": "catalog:",
"eslint-plugin-no-only-tests": "catalog:",
Expand Down
2 changes: 1 addition & 1 deletion e2e/compilation-cases/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"@stylistic/eslint-plugin": "catalog:",
"@typescript-eslint/eslint-plugin": "catalog:",
"@typescript-eslint/parser": "catalog:",
"eslint-config-devextreme": "1.1.6",
"eslint-config-devextreme": "catalog:",
"eslint-migration-utils": "workspace:*",
"eslint-plugin-i18n": "catalog:",
"eslint-plugin-import": "catalog:",
Expand Down
3 changes: 2 additions & 1 deletion e2e/testcafe-devextreme/docker/run-testcafe.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const matrix = [
];
(async() => {

// eslint-disable-next-line no-undef
const parsedArgs = parseArgs(process.argv);
const componentFolderName = parsedArgs.componentFolder;
let testParts = matrix;
Expand All @@ -45,7 +46,7 @@ const matrix = [

// eslint-disable-next-line no-restricted-syntax
for (const { name, ...args } of testParts) {
// eslint-disable-next-line no-console
// eslint-disable-next-line no-console,no-undef
console.log(`Started test: ${name}`);

const startupParams = Object.entries(args).map(([key, value]) => `--${key}=${value}`);
Expand Down
15 changes: 9 additions & 6 deletions e2e/testcafe-devextreme/eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ import js from '@eslint/js';
import { FlatCompat as FlatCompatibility } from '@eslint/eslintrc';
import stylistic from '@stylistic/eslint-plugin';
import { changeRulesToStylistic } from 'eslint-migration-utils';
import spellCheckConfig from 'eslint-config-devextreme/spell-check';
import typescriptConfig from 'eslint-config-devextreme/typescript';
import testcafeConfig from 'eslint-config-devextreme/testcafe';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
Expand All @@ -24,8 +27,8 @@ export default [
'node_modules/**',
],
},
...compatibility.extends('devextreme/spell-check'),
...compatibility.extends('devextreme/testcafe'),
...spellCheckConfig,
...testcafeConfig,
{
plugins: {
'no-only-tests': noOnlyTests,
Expand Down Expand Up @@ -128,7 +131,6 @@ export default [
'space-before-function-paren': ['error', 'never'],
'space-in-parens': 'error',
'space-infix-ops': 'error',
'space-unary-ops': 'error',
'@stylistic/space-infix-ops': 'error',
'space-unary-ops': 'error',
'spaced-comment': ['error', 'always', {
Expand All @@ -155,7 +157,7 @@ export default [
'import/no-duplicates': 2,
}
},
...compatibility.extends('devextreme/typescript').map(config => {
...typescriptConfig.map(config => {
const newConfig = {
...config,
files: ['**/*.ts?(x)'],
Expand Down Expand Up @@ -216,10 +218,11 @@ export default [
'no-await-in-loop': 'off',
'@stylistic/no-extra-parens': 'off',
'@typescript-eslint/require-await': 'off',
'@typescript-eslint/no-base-to-string': 'off'
'@typescript-eslint/no-base-to-string': 'off',
'require-await': 'off',
},
},
...compatibility.extends('devextreme/typescript').map(config => {
...typescriptConfig.map(config => {
const newConfig = {
...config,
files: ['**/*.d.ts'],
Expand Down
6 changes: 3 additions & 3 deletions e2e/testcafe-devextreme/helpers/domUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const getStyleAttribute = ClientFunction((selector) => {
export const setStyleAttribute = ClientFunction((selector, styleValue) => {
const element = selector();

const styles = element.getAttribute('style') || '';
const styles = element.getAttribute('style') ?? '';
const updatedStyles = `${styles} ${styleValue}`;

element.setAttribute('style', updatedStyles);
Expand All @@ -44,7 +44,7 @@ export const setStyleAttribute = ClientFunction((selector, styleValue) => {
export const setClassAttribute = ClientFunction((selector, styleValue) => {
const element = selector();

const styles = element.getAttribute('class') || '';
const styles = element.getAttribute('class') ?? '';
const updatedClasses = `${styles} ${styleValue}`;

element.setAttribute('class', updatedClasses);
Expand All @@ -53,7 +53,7 @@ export const setClassAttribute = ClientFunction((selector, styleValue) => {
export const removeClassAttribute = ClientFunction((selector, styleValue) => {
const element = selector();

const styles = element.getAttribute('class') || '';
const styles = element.getAttribute('class') ?? '';
const updatedClasses = `${styles.replace(styleValue, '')}`;

element.setAttribute('class', updatedClasses);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

/* eslint-disable no-undef */
function getRoot() {
return document.querySelector('#parentContainer').shadowRoot;
}
Expand Down
2 changes: 1 addition & 1 deletion e2e/testcafe-devextreme/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"@stylistic/eslint-plugin": "catalog:",
"@typescript-eslint/eslint-plugin": "catalog:",
"@typescript-eslint/parser": "catalog:",
"eslint-config-devextreme": "1.1.6",
"eslint-config-devextreme": "catalog:",
"eslint-migration-utils": "workspace:*",
"eslint-plugin-i18n": "catalog:",
"eslint-plugin-import": "catalog:",
Expand Down
2 changes: 1 addition & 1 deletion e2e/testcafe-devextreme/runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ async function main() {

await t.hover('html');

const [width, height] = meta?.browserSize || DEFAULT_BROWSER_SIZE;
const [width, height] = meta?.browserSize ?? DEFAULT_BROWSER_SIZE;
await t.resizeWindow(width, height);
} else {
await loadAxeCore(t);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ test.meta({ themes: [Themes.genericLight] })('ContextMenu width should be adjust
visible: true,
},
onContextMenuPreparing(e) {
if (e.field && e.field.dataField === 'amount') {
if (e.field?.dataField === 'amount') {
const menuItems = [] as any;

e.items.push({ text: 'Summary Type', items: menuItems });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const getVisibleColumns = (dataGrid: DataGrid): Promise<string[]> => {
return ClientFunction(
() => (getInstance() as any)
.getVisibleColumns()
.map((column: any) => column.dataField || column.name),
.map((column: any) => column.dataField ?? column.name),
{ dependencies: { getInstance } },
)();
};
Expand Down
13 changes: 6 additions & 7 deletions packages/devextreme-angular/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
/* eslint-disable spellcheck/spell-checker */
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import { FlatCompat } from '@eslint/eslintrc';
import babelParser from '@babel/eslint-parser';
import tsParser from '@typescript-eslint/parser';
import stylistic from '@stylistic/eslint-plugin';
import importPlugin from 'eslint-plugin-import';
import { changeRulesToStylistic } from 'eslint-migration-utils';
import spellCheckConfig from 'eslint-config-devextreme/spell-check';
import javascriptConfig from 'eslint-config-devextreme/javascript';
import typescriptConfig from 'eslint-config-devextreme/typescript';

const filename = fileURLToPath(import.meta.url);
const dirname = path.dirname(filename);
const compat = new FlatCompat({
baseDirectory: dirname,
});

export default [
{
Expand Down Expand Up @@ -42,15 +41,15 @@ export default [
},
},
},
...compat.extends('devextreme/spell-check'),
...compat.extends('devextreme/javascript').map((config) => ({
...spellCheckConfig,
...javascriptConfig.map((config) => ({
...config,
files: ['**/*.js', '**/*.mjs'],
languageOptions: {
parser: babelParser,
},
})),
...compat.extends('devextreme/typescript').map((config) => ({
...typescriptConfig.map((config) => ({
...config,
rules: config.rules
? changeRulesToStylistic(config.rules)
Expand Down
2 changes: 1 addition & 1 deletion packages/devextreme-angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"css-loader": "6.10.0",
"devextreme-metadata": "workspace:*",
"eslint": "catalog:",
"eslint-config-devextreme": "1.1.5",
"eslint-config-devextreme": "catalog:",
"eslint-plugin-import": "catalog:",
"eslint-migration-utils": "workspace:*",
"jasmine": "5.12.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ describe('Universal', () => {
expect(fixture.detectChanges.bind(fixture)).not.toThrow();
});

// eslint-disable-next-line require-await
it('should not throw error if core/renderer is called (T1255582)', async () => {
TestBed.overrideComponent(TestContainerComponent, {
set: {
Expand Down
15 changes: 5 additions & 10 deletions packages/devextreme-react/eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import { FlatCompat } from '@eslint/eslintrc';
import stylistic from '@stylistic/eslint-plugin';
import importPlugin from 'eslint-plugin-import';
import { changeRulesToStylistic } from 'eslint-migration-utils';
import spellCheckConfig from 'eslint-config-devextreme/spell-check';
import typescriptConfig from 'eslint-config-devextreme/typescript';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
Expand All @@ -24,7 +26,7 @@ export default [
'**/__tests__/**',
],
},
...compat.extends('devextreme/spell-check').map(config => {
...spellCheckConfig.map(config => {

const newConfig = {
...config
Expand Down Expand Up @@ -156,7 +158,6 @@ export default [
'space-before-function-paren': ['error', 'never'],
'space-in-parens': 'error',
'space-infix-ops': 'error',
'space-unary-ops': 'error',
'@stylistic/space-infix-ops': 'error',
'space-unary-ops': 'error',
Comment thread
anna-shakhova marked this conversation as resolved.
'spaced-comment': ['error', 'always', {
Expand Down Expand Up @@ -186,7 +187,7 @@ export default [
},

},
...compat.extends('devextreme/typescript').map(config => {
...typescriptConfig.map(config => {
const newConfig = {
...config,
files: ['**/*.ts?(x)'],
Expand All @@ -202,9 +203,6 @@ export default [
{
files: ['**/*.ts?(x)'],
ignores: ['**/*.d.ts'],
plugins: {
'@stylistic': stylistic,
},
languageOptions: {
Comment thread
anna-shakhova marked this conversation as resolved.
parser: tsParser,
ecmaVersion: 6,
Expand Down Expand Up @@ -239,7 +237,7 @@ export default [
'@typescript-eslint/naming-convention': 'off',
},
},
...compat.extends('devextreme/typescript').map(config => {
...typescriptConfig.map(config => {
const newConfig = {
...config,
files: ['**/*.d.ts'],
Expand All @@ -253,9 +251,6 @@ export default [
}),
{
files: ['**/*.d.ts'],
plugins: {
'@stylistic': stylistic,
},
languageOptions: {
Comment thread
anna-shakhova marked this conversation as resolved.
parser: tsParser,
ecmaVersion: 6,
Expand Down
2 changes: 1 addition & 1 deletion packages/devextreme-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
"eslint-plugin-import": "catalog:",
"@typescript-eslint/eslint-plugin": "catalog:",
"@typescript-eslint/parser": "catalog:",
"eslint-config-devextreme": "1.1.6"
"eslint-config-devextreme": "catalog:"
},
"publishConfig": {
"directory": "npm",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ function compareCollections(
Object.keys(current.configCollections).forEach((key) => {
const currentCollection = current.configCollections[key];
const prevCollection = prev.configCollections[key] || [];
// eslint-disable-next-line @typescript-eslint/prefer-optional-chain
if (!currentCollection || currentCollection.length !== prevCollection.length) {
Comment thread
anna-shakhova marked this conversation as resolved.
const updatedCollection: Record<string, any>[] = [];
currentCollection.forEach(
Expand Down
6 changes: 3 additions & 3 deletions packages/devextreme-react/src/core/use-option-scanning.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ export function useOptionScanning(
parentUpdateToken: symbol,
parentType: 'option' | 'component',
): [
IConfigNode,
NestedOptionContextContent,
] {
IConfigNode,
NestedOptionContextContent,
] {
const parentContext = useContext(NestedOptionContext);

const {
Expand Down
10 changes: 5 additions & 5 deletions packages/devextreme-react/src/core/widget-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const internalProps: InternalProps = {
defaults: {},
templateProps: [],
expectedChildren: {},
// eslint-disable-next-line spellcheck/spell-checker

subscribableOptions: [],
independentEvents: [],
useRequestAnimationFrameFlag: false,
Expand Down Expand Up @@ -48,10 +48,10 @@ function separateProps(
defaultsProps: Record<string, string>,
templateProps: ITemplateMeta[],
): {
options: Record<string, any>;
defaults: Record<string, any>;
templates: Record<string, any>;
} {
options: Record<string, any>;
defaults: Record<string, any>;
templates: Record<string, any>;
} {
// eslint-disable-next-line no-param-reassign
templateProps = templateProps || [];
const defaults: Record<string, any> = {};
Expand Down
2 changes: 1 addition & 1 deletion packages/devextreme-themebuilder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"@types/fs-extra": "11.0.4",
"@types/node": "20.11.17",
"eslint-config-airbnb-base": "15.0.0",
"eslint-config-devextreme": "1.1.5",
"eslint-config-devextreme": "catalog:",
"eslint": "catalog:",
"eslint-plugin-import": "catalog:",
"eslint-config-airbnb-typescript": "catalog:",
Expand Down
Loading
Loading