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
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export class AppComponent {
this.clientsStore = new CustomStore({
key: 'Value',
useDefaultSearch: true,
async load(loadOptions) {
load(loadOptions) {
let params: HttpParams = new HttpParams();
[
'skip',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export class AppService {
});
}

async getAIResponse(messages: AIMessage[]): Promise<string> {
getAIResponse(messages: AIMessage[]): Promise<string> {
return this.aiService.getAIResponse(messages) as Promise<string>;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ export class AppService {
initDataSource() {
this.customStore = new CustomStore({
key: 'id',
load: async () => this.messages,
insert: async (message) => {
load: () => this.messages,
insert: (message) => {
this.messages.push(message);
return message;
},
Expand Down
6 changes: 3 additions & 3 deletions apps/demos/Demos/Chat/FileAttachments/React/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ const store: ChatTypes.Message[] = [...initialMessages];

const customStore = new CustomStore({
key: 'id',
load: async () => store,
insert: async (message: ChatTypes.Message) => {
load: () => Promise.resolve(store),
insert: (message: ChatTypes.Message) => {
store.push(message);
return message;
return Promise.resolve(message);
},
});

Expand Down
6 changes: 3 additions & 3 deletions apps/demos/Demos/Chat/FileAttachments/ReactJs/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import { currentUser, messages as initialMessages } from './data.js';
const store = [...initialMessages];
const customStore = new CustomStore({
key: 'id',
load: async () => store,
insert: async (message) => {
load: () => Promise.resolve(store),
insert: (message) => {
store.push(message);
return message;
return Promise.resolve(message);
},
});
const dataSource = new DataSource({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ export class AppService {
initDataSource() {
this.customStore = new CustomStore({
key: 'id',
load: async () => this.messages,
insert: async (message) => {
load: () => this.messages,
insert: (message) => {
this.messages.push(message);
return message;
},
Expand Down
6 changes: 3 additions & 3 deletions apps/demos/Demos/Chat/MessageEditing/React/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ const store: ChatTypes.Message[] = [...initialMessages];

const customStore = new CustomStore({
key: 'id',
load: async (): Promise<ChatTypes.Message[]> => store,
insert: async (message: ChatTypes.Message): Promise<ChatTypes.Message> => {
load: (): Promise<ChatTypes.Message[]> => Promise.resolve(store),
insert: (message: ChatTypes.Message): Promise<ChatTypes.Message> => {
store.push(message);
return message;
return Promise.resolve(message);
},
});

Expand Down
6 changes: 3 additions & 3 deletions apps/demos/Demos/Chat/MessageEditing/ReactJs/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ const editingStrategy = {
const store = [...initialMessages];
const customStore = new CustomStore({
key: 'id',
load: async () => store,
insert: async (message) => {
load: () => Promise.resolve(store),
insert: (message) => {
store.push(message);
return message;
return Promise.resolve(message);
},
});
const dataSource = new DataSource({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ async function getAIResponse(messages: AIMessage[], signal: AbortSignal) {
return result;
}

async function getAIResponseRecursive(messages: AIMessage[], signal: AbortSignal): Promise<string> {
function getAIResponseRecursive(messages: AIMessage[], signal: AbortSignal): Promise<string> {
return getAIResponse(messages, signal)
.catch(async (error) => {
if (!error.message.includes('Connection error')) {
Expand Down
2 changes: 1 addition & 1 deletion apps/demos/Demos/DataGrid/AIColumns/React/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ async function getAIResponse(messages: AIMessage[], signal: AbortSignal) {
return result ?? '';
}

async function getAIResponseRecursive(messages: AIMessage[], signal: AbortSignal): Promise<string> {
function getAIResponseRecursive(messages: AIMessage[], signal: AbortSignal): Promise<string> {
return getAIResponse(messages, signal)
.catch(async (error) => {
if (!error.message.includes('Connection error')) {
Expand Down
2 changes: 1 addition & 1 deletion apps/demos/Demos/DataGrid/AIColumns/ReactJs/service.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ async function getAIResponse(messages, signal) {
const result = response.choices[0].message?.content;
return result ?? '';
}
async function getAIResponseRecursive(messages, signal) {
function getAIResponseRecursive(messages, signal) {
return getAIResponse(messages, signal).catch(async (error) => {
if (!error.message.includes('Connection error')) {
return Promise.reject(error);
Expand Down
2 changes: 1 addition & 1 deletion apps/demos/Demos/DataGrid/AIColumns/Vue/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ async function getAIResponse(messages: AIMessage[], signal: AbortSignal) {
return result;
}

async function getAIResponseRecursive(messages: AIMessage[], signal: AbortSignal): Promise<string> {
function getAIResponseRecursive(messages: AIMessage[], signal: AbortSignal): Promise<string> {
return getAIResponse(messages, signal)
.catch(async (error) => {
if (!error.message.includes('Connection error')) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export class Service {
return data;
}

async saveChange(change: Change<Order>): Promise<Order> {
saveChange(change: Change<Order>): Promise<Order> {
switch (change.type) {
case 'insert':
return this.insert(change);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export async function saveChange(dispatch: dispatchType, change: DataGridTypes.D
}
}

async function sendChange(url: string, change: DataGridTypes.DataChange) {
function sendChange(url: string, change: DataGridTypes.DataChange) {
switch (change.type) {
case 'insert':
return sendRequest(`${url}/InsertOrder`, 'POST', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export async function saveChange(dispatch, change) {
return null;
}
}
async function sendChange(url, change) {
function sendChange(url, change) {
switch (change.type) {
case 'insert':
return sendRequest(`${url}/InsertOrder`, 'POST', {
Expand Down
2 changes: 1 addition & 1 deletion apps/demos/Demos/DataGrid/PDFExportImages/React/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const onExporting = ({ component }: DataGridTypes.ExportingEvent) => {
}
},
customDrawCell: (e: CustomDrawCellEvent) => {
if (e.gridCell && e.gridCell.rowType === 'data' && e.gridCell.column?.dataField === 'Picture' && e.rect) {
if (e.gridCell?.rowType === 'data' && e.gridCell.column?.dataField === 'Picture' && e.rect) {
doc.addImage(e.gridCell.value, 'PNG', e.rect.x, e.rect.y, e.rect.w, e.rect.h);
e.cancel = true;
}
Expand Down
7 changes: 1 addition & 6 deletions apps/demos/Demos/DataGrid/PDFExportImages/ReactJs/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,7 @@ const onExporting = ({ component }) => {
}
},
customDrawCell: (e) => {
if (
e.gridCell &&
e.gridCell.rowType === 'data' &&
e.gridCell.column?.dataField === 'Picture' &&
e.rect
) {
if (e.gridCell?.rowType === 'data' && e.gridCell.column?.dataField === 'Picture' && e.rect) {
doc.addImage(e.gridCell.value, 'PNG', e.rect.x, e.rect.y, e.rect.w, e.rect.h);
e.cancel = true;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
declare module 'npm:devextreme/localization/messages/de.json!json'{
declare module 'npm:devextreme/localization/messages/de.json!json' {
const json: object;
export = json;
}

declare module 'npm:devextreme/localization/messages/ru.json!json'{
declare module 'npm:devextreme/localization/messages/ru.json!json' {
const json: object;
export = json;
}
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export class AppComponent {
}

prepareContextMenu(e: DxPivotGridTypes.ContextMenuPreparingEvent) {
if (e.field && e.field.dataField === 'amount') {
if (e.field?.dataField === 'amount') {
this.summaryDisplayModes.forEach((mode) => {
e.items.push({
text: mode.text,
Expand All @@ -80,8 +80,7 @@ export class AppComponent {
let format: string;
const caption = mode.value === 'none' ? 'Total Sales' : 'Relative Sales';

if (mode.value === 'none'
|| mode.value === 'absoluteVariation') {
if (mode.value === 'none' || mode.value === 'absoluteVariation') {
format = 'currency';
}
this.pivotGridDataSource.field(e.field.index, {
Expand Down
3 changes: 1 addition & 2 deletions apps/demos/Demos/Scheduler/ContextMenu/React/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ const App = () => {
},
...resourceItems,
]);
}
, []);
}, []);

const onCellContextMenu = useCallback((e: SchedulerTypes.CellContextMenuEvent) => {
const scheduler = schedulerRef.current?.instance();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ async function getAIResponse(messages: AIMessage[], signal: AbortSignal) {
return result;
}

async function getAIResponseRecursive(messages: AIMessage[], signal: AbortSignal): Promise<string> {
function getAIResponseRecursive(messages: AIMessage[], signal: AbortSignal): Promise<string> {
return getAIResponse(messages, signal)
.catch(async (error) => {
if (!error.message.includes('Connection error')) {
Expand Down
2 changes: 1 addition & 1 deletion apps/demos/Demos/TreeList/AIColumns/React/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ async function getAIResponse(messages: AIMessage[], signal: AbortSignal): Promis
return result ?? '';
}

async function getAIResponseRecursive(messages: AIMessage[], signal: AbortSignal): Promise<string> {
function getAIResponseRecursive(messages: AIMessage[], signal: AbortSignal): Promise<string> {
return getAIResponse(messages, signal)
.catch(async (error) => {
if (!error.message.includes('Connection error')) {
Expand Down
2 changes: 1 addition & 1 deletion apps/demos/Demos/TreeList/AIColumns/ReactJs/service.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ async function getAIResponse(messages, signal) {
const result = response.choices[0].message?.content;
return result ?? '';
}
async function getAIResponseRecursive(messages, signal) {
function getAIResponseRecursive(messages, signal) {
return getAIResponse(messages, signal).catch(async (error) => {
if (!error.message.includes('Connection error')) {
return Promise.reject(error);
Expand Down
2 changes: 1 addition & 1 deletion apps/demos/Demos/TreeList/AIColumns/Vue/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ async function getAIResponse(messages: AIMessage[], signal: AbortSignal) {
return result;
}

async function getAIResponseRecursive(messages: AIMessage[], signal: AbortSignal): Promise<string> {
function getAIResponseRecursive(messages: AIMessage[], signal: AbortSignal): Promise<string> {
return getAIResponse(messages, signal)
.catch(async (error) => {
if (!error.message.includes('Connection error')) {
Expand Down
49 changes: 38 additions & 11 deletions apps/demos/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
import globals from 'globals';
import babelParser from '@babel/eslint-parser';
import spellcheckDevextreme from 'eslint-config-devextreme/spell-check.js';
import spellcheckDevextreme from 'eslint-config-devextreme/spell-check';
import testcafeConfig from 'eslint-config-devextreme/testcafe';
import typescriptConfig from 'eslint-config-devextreme/typescript';
import javascriptConfig from 'eslint-config-devextreme/javascript';
import spellcheckPlugin from 'eslint-plugin-spellcheck';
import noOnlyTests from 'eslint-plugin-no-only-tests';
import deprecation from 'eslint-plugin-deprecation';
import reactPlugin from 'eslint-plugin-react';
import reactHooks from 'eslint-plugin-react-hooks';
import reactPerf from 'eslint-plugin-react-perf';
import jest from 'eslint-plugin-jest';
import vuePlugin from 'eslint-plugin-vue';
import vueParser from 'vue-eslint-parser';
import tsParser from '@typescript-eslint/parser';
import tsPlugin from '@typescript-eslint/eslint-plugin';
Expand All @@ -28,7 +32,7 @@ const compat = new FlatCompat({
allConfig: js.configs.all
});

const spellcheckRule = spellcheckDevextreme.rules['spellcheck/spell-checker'];
const spellcheckRule = spellcheckDevextreme[0].rules['spellcheck/spell-checker'];

export default [
{
Expand Down Expand Up @@ -76,13 +80,13 @@ export default [
},
},

...compat.extends('eslint:recommended', 'devextreme/spell-check'),

...compat.extends('devextreme/javascript').map(config => ({
js.configs.recommended,
...spellcheckDevextreme,
...javascriptConfig.map(config => ({
...config,
rules: changeRulesToStylistic(config.rules || {}),
})),
...compat.extends('devextreme/typescript').map(config => ({
...typescriptConfig.map(config => ({
...config,
files: ['**/*.ts', '**/*.tsx'],
rules: changeRulesToStylistic(config.rules || {}),
Expand Down Expand Up @@ -257,6 +261,7 @@ export default [
'@typescript-eslint/ban-ts-comment': 0,
'@typescript-eslint/no-extraneous-class': 0,
'@typescript-eslint/no-floating-promises': 0,
'@typescript-eslint/only-throw-error': 'warn',
},
},

Expand Down Expand Up @@ -369,7 +374,7 @@ export default [
},

// Vue demos
...compat.extends('plugin:vue/vue3-recommended').map(config => ({
...vuePlugin.configs['flat/recommended'].map(config => ({
...config,
files: [
'Demos/**/Vue/*.vue',
Expand Down Expand Up @@ -466,9 +471,13 @@ export default [
},

// testcafe tests
...compat.extends('devextreme/testcafe').map(config => ({
...testcafeConfig.map(config => ({
...config,
rules: changeRulesToStylistic(config.rules || {}),
rules: {
...changeRulesToStylistic(config.rules || {}),
'require-await': 'warn',

},
files: ['testing/**/*.{js,ts}', 'utils/visual-tests/**/*.*'],
})),

Expand Down Expand Up @@ -501,7 +510,25 @@ export default [
// utils directory
{
files: [
'utils/**/*.{js,ts}',
'utils/**/*.js',
],
ignores: [
'utils/testing/',
'utils/visual-tests/',
'utils/templates/',
],
rules: {
'no-console': 0,
'no-await-in-loop': 0,
'no-restricted-syntax': 0,
'@typescript-eslint/await-thenable': 0,
'spellcheck/spell-checker': 0,
'consistent-return': 0,
},
},
{
files: [
'utils/**/*.ts',
],
ignores: [
'utils/testing/',
Expand All @@ -510,7 +537,7 @@ export default [
],
languageOptions: {
parserOptions: {
projectService: true,
project: './tsconfig.json',
},
},
rules: {
Expand Down
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
Loading
Loading