Skip to content
Draft
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
23 changes: 10 additions & 13 deletions apps/demos/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import globals from 'globals';
import babelParser from '@babel/eslint-parser';
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';
Expand All @@ -15,7 +13,6 @@ import vuePlugin from 'eslint-plugin-vue';
import vueParser from 'vue-eslint-parser';
import tsParser from '@typescript-eslint/parser';
import js from '@eslint/js';
import { fixupPluginRules } from '@eslint/compat';
import { FlatCompat } from '@eslint/eslintrc';
import stylistic from '@stylistic/eslint-plugin';
import { fileURLToPath } from 'node:url';
Expand Down Expand Up @@ -51,29 +48,21 @@ export default [
],
},

// Plugins and parser
// Plugins and language options
{
plugins: {
spellcheck: spellcheckPlugin,
'no-only-tests': noOnlyTests,
'@stylistic': stylistic,
jest,
'deprecation': fixupPluginRules(deprecation),
},
languageOptions: {
globals: {
...globals.browser,
...globals.es6,
},
parser: babelParser,
ecmaVersion: 2018,
sourceType: 'module',
parserOptions: {
requireConfigFile: false,
babelOptions: {
presets: ['@babel/preset-react'],
},
},
},
},

Expand Down Expand Up @@ -191,6 +180,14 @@ export default [
// .js and .jsx files
{
files: ['**/*.js', '**/*.jsx'],
languageOptions: {
ecmaVersion: 'latest',
parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
},
rules: {
'no-unused-vars': 'error',
}
Expand Down Expand Up @@ -222,7 +219,7 @@ export default [
'no-underscore-dangle': 0,
'operator-assignment': 0,

'deprecation/deprecation': 'error',
'@typescript-eslint/no-deprecated': 'error',

'@typescript-eslint/naming-convention': 0,
'@typescript-eslint/no-throw-literal': 0,
Expand Down
4 changes: 0 additions & 4 deletions apps/demos/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,8 @@
"devDependencies": {
"@angular/platform-server": "^22.2.1",
"@babel/core": "7.29.7",
"@babel/eslint-parser": "catalog:",
"@babel/preset-env": "7.29.7",
"@babel/preset-react": "7.29.7",
"@babel/preset-typescript": "7.29.7",
"@eslint/compat": "1.4.1",
"@eslint/eslintrc": "catalog:",
"@eslint/js": "catalog:",
"@stylistic/eslint-plugin": "catalog:",
Expand All @@ -116,7 +113,6 @@
"eslint": "catalog:",
"eslint-config-airbnb-typescript": "catalog:",
"eslint-config-devextreme": "catalog:",
"eslint-plugin-deprecation": "3.0.0",
"eslint-plugin-import": "catalog:",
"eslint-plugin-jest": "29.15.2",
"eslint-plugin-no-only-tests": "catalog:",
Expand Down
5 changes: 0 additions & 5 deletions e2e/bundlers/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import babelParser from '@babel/eslint-parser';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import js from '@eslint/js';
Expand Down Expand Up @@ -52,10 +51,6 @@ export default [
module: true,
exports: true,
},
parser: babelParser,
parserOptions: {
requireConfigFile: false,
},
},
plugins: {
'@stylistic': stylistic,
Expand Down
6 changes: 1 addition & 5 deletions e2e/testcafe-devextreme/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/* eslint-disable spellcheck/spell-checker */
import noOnlyTests from 'eslint-plugin-no-only-tests';
import i18N from 'eslint-plugin-i18n';
import babelParser from '@babel/eslint-parser';
import tsParser from '@typescript-eslint/parser';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
Expand Down Expand Up @@ -60,10 +59,7 @@ export default [
module: true,
exports: true,
},
parser: babelParser,
parserOptions: {
requireConfigFile: false,
},
ecmaVersion: 'latest',
},
plugins: {
'@stylistic': stylistic,
Expand Down
1 change: 0 additions & 1 deletion e2e/testcafe-devextreme/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"update-failed-etalons": "node update_failed_etalons.mjs"
},
"devDependencies": {
"@babel/eslint-parser": "catalog:",
"@babel/plugin-transform-runtime": "7.29.7",
"@testcafe-community/axe": "3.5.0",
"@types/jquery": "catalog:",
Expand Down
10 changes: 3 additions & 7 deletions packages/devextreme-angular/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/* eslint-disable spellcheck/spell-checker */
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import babelParser from '@babel/eslint-parser';
import tsParser from '@typescript-eslint/parser';
import stylistic from '@stylistic/eslint-plugin';
import importPlugin from 'eslint-plugin-import';
Expand Down Expand Up @@ -30,12 +29,12 @@ export default [
},
},
{
files: ['**/*.ts'],
languageOptions: {
parser: tsParser,
parserOptions: {
project: './tsconfig.json',
tsconfigRootDir: dirname,
requireConfigFile: false,
ecmaVersion: 6,
sourceType: 'module',
},
Expand All @@ -46,7 +45,7 @@ export default [
...config,
files: ['**/*.js', '**/*.mjs'],
languageOptions: {
parser: babelParser,
ecmaVersion: 'latest',
},
})),
...typescriptConfig.map((config) => ({
Expand Down Expand Up @@ -87,9 +86,6 @@ export default [
},
{
files: ['**/*.js', '**/*.mjs'],
languageOptions: {
parser: babelParser,
},
rules: {
'global-require': 'off',
'import/no-unresolved': 'off',
Expand All @@ -116,7 +112,7 @@ export default [
'@typescript-eslint/restrict-plus-operands': 'warn',
'@typescript-eslint/no-this-alias': 'warn',
'@typescript-eslint/prefer-optional-chain': 'warn',
'@typescript-eslint/init-declarations': 'warn',
'@typescript-eslint/init-declarations': ['warn', 'always'],
'@typescript-eslint/prefer-nullish-coalescing': 'warn',
'@typescript-eslint/no-use-before-define': 'warn',
'@typescript-eslint/member-ordering': 'warn',
Expand Down
1 change: 0 additions & 1 deletion packages/devextreme-angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
"@angular/platform-browser": "catalog:angular",
"@angular/platform-browser-dynamic": "catalog:angular",
"@angular/platform-server": "catalog:angular",
"@babel/eslint-parser": "catalog:",
"@eslint-stylistic/metadata": "catalog:",
"@eslint/eslintrc": "catalog:",
"@stylistic/eslint-plugin": "catalog:",
Expand Down
5 changes: 0 additions & 5 deletions packages/devextreme-react/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import i18N from 'eslint-plugin-i18n';
import babelParser from '@babel/eslint-parser';
import tsParser from '@typescript-eslint/parser';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
Expand Down Expand Up @@ -84,10 +83,6 @@ export default [
module: true,
exports: true,
},
parser: babelParser,
parserOptions: {
requireConfigFile: false,
},
},
plugins: {
'@stylistic': stylistic,
Expand Down
1 change: 0 additions & 1 deletion packages/devextreme-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@
"typescript": "catalog:tools",
"typescript-min": "npm:typescript@4.9.5",
"eslint": "catalog:",
"@babel/eslint-parser": "catalog:",
"@eslint/eslintrc": "catalog:",
"@eslint/js": "catalog:",
"@stylistic/eslint-plugin": "catalog:",
Expand Down
5 changes: 0 additions & 5 deletions packages/devextreme-vue/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import js from "@eslint/js";
import tsParser from "@typescript-eslint/parser";
import babelParser from '@babel/eslint-parser';
import importPlugin from "eslint-plugin-import";
import spellcheck from "eslint-plugin-spellcheck";
import i18N from "eslint-plugin-i18n";
Expand Down Expand Up @@ -47,10 +46,6 @@ export default [
{
files: ["**/*.js"],
languageOptions: {
parser: babelParser,
parserOptions: {
requireConfigFile: false,
},
globals: {
setInterval: true,
setTimeout: true,
Expand Down
1 change: 0 additions & 1 deletion packages/devextreme-vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@
"eslint-plugin-import": "catalog:",
"eslint-plugin-no-only-tests": "catalog:",
"eslint-plugin-vue": "catalog:",
"@babel/eslint-parser": "catalog:",
"@typescript-eslint/eslint-plugin": "catalog:",
"@typescript-eslint/parser": "catalog:",
"vue-eslint-parser": "catalog:"
Expand Down
7 changes: 1 addition & 6 deletions packages/devextreme/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/* eslint-disable spellcheck/spell-checker */
import noOnlyTests from 'eslint-plugin-no-only-tests';
import i18N from 'eslint-plugin-i18n';
import babelParser from '@babel/eslint-parser';
import tsParser from '@typescript-eslint/parser';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
Expand Down Expand Up @@ -80,10 +79,6 @@ export default [
module: true,
exports: true,
},
parser: babelParser,
parserOptions: {
requireConfigFile: false,
},
},
rules: {
'i18n/no-russian-character': ['error', {
Expand Down Expand Up @@ -556,7 +551,7 @@ export default [
'array-callback-return': 'warn',
'class-methods-use-this': 'warn',
'@typescript-eslint/explicit-function-return-type': 'warn',
'@typescript-eslint/init-declarations': 'warn',
'@typescript-eslint/init-declarations': ['warn', 'always'],
'@typescript-eslint/no-unsafe-return': 'warn',
'@typescript-eslint/no-invalid-this': 'warn',
'@typescript-eslint/no-explicit-any': 'warn',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const STATE_MANAGER_PATH = '/core/state_manager/';
const VALID_IMPORT = '"@ts/core/state_manager/index"';

function validate(context, node, sourceNode) {
const filename = context.getFilename();
const { filename } = context;
const isStateManagerModule = filename.includes(STATE_MANAGER_PATH);

if(!isStateManagerModule) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,55 +91,58 @@ function hydrateChildren(parentVNode: VNode, parentNode: any, currentNode: any,
const props = parentVNode.props;
const flags = parentVNode.flags;

if (childFlags !== ChildFlags.HasInvalidChildren) {
if (childFlags === ChildFlags.HasVNodeChildren) {
if (isNull(currentNode)) {
_M(children as VNode, parentNode, context, isSVG, null, lifecycle, animations);
} else {
currentNode = hydrateVNode(children as VNode, parentNode, currentNode as Element, context, isSVG, lifecycle, animations);
currentNode = currentNode ? currentNode.nextSibling : null;
if (childFlags === ChildFlags.HasInvalidChildren) {
if (!isNull(parentNode.firstChild) && !isSamePropsInnerHTML(parentNode, props)) {
parentNode.textContent = ''; // dom has content, but VNode has no children remove everything from DOM
if (flags & VNodeFlags.FormElement) {
// If element is form element, we need to clear defaultValue also
(parentNode as any).defaultValue = '';
}
} else if (childFlags === ChildFlags.HasTextChildren) {
if (isNull(currentNode)) {
parentNode.appendChild(document.createTextNode(children as string));
} else if (parentNode.childNodes.length !== 1 || currentNode.nodeType !== 3) {
parentNode.textContent = children as string;
} else if (currentNode.nodeValue !== children) {
currentNode.nodeValue = children as string;
}
currentNode = null;
} else if (childFlags & ChildFlags.MultipleChildren) {
let prevVNodeIsTextNode = false;
}
return;
}

for (let i = 0, len = (children as VNode[]).length; i < len; ++i) {
const child = (children as VNode[])[i];
if (childFlags === ChildFlags.HasVNodeChildren) {
if (isNull(currentNode)) {
_M(children as VNode, parentNode, context, isSVG, null, lifecycle, animations);
} else {
currentNode = hydrateVNode(children as VNode, parentNode, currentNode as Element, context, isSVG, lifecycle, animations);
currentNode = currentNode ? currentNode.nextSibling : null;
}
} else if (childFlags === ChildFlags.HasTextChildren) {
if (isNull(currentNode)) {
parentNode.appendChild(document.createTextNode(children as string));
} else if (parentNode.childNodes.length !== 1 || currentNode.nodeType !== 3) {
parentNode.textContent = children as string;
} else if (currentNode.nodeValue !== children) {
currentNode.nodeValue = children as string;
}
currentNode = null;
} else if (childFlags & ChildFlags.MultipleChildren) {
let prevVNodeIsTextNode = false;

if (isNull(currentNode) || (prevVNodeIsTextNode && (child.flags & VNodeFlags.Text) > 0)) {
_M(child as VNode, parentNode, context, isSVG, currentNode, lifecycle, animations);
} else {
currentNode = hydrateVNode(child as VNode, parentNode, currentNode as Element, context, isSVG, lifecycle, animations);
currentNode = currentNode ? currentNode.nextSibling : null;
}
for (let i = 0, len = (children as VNode[]).length; i < len; ++i) {
const child = (children as VNode[])[i];

prevVNodeIsTextNode = (child.flags & VNodeFlags.Text) > 0;
if (isNull(currentNode) || (prevVNodeIsTextNode && (child.flags & VNodeFlags.Text) > 0)) {
_M(child as VNode, parentNode, context, isSVG, currentNode, lifecycle, animations);
} else {
currentNode = hydrateVNode(child as VNode, parentNode, currentNode as Element, context, isSVG, lifecycle, animations);
currentNode = currentNode ? currentNode.nextSibling : null;
}

prevVNodeIsTextNode = (child.flags & VNodeFlags.Text) > 0;
}
}

// clear any other DOM nodes, there should be only a single entry for the root
if ((flags & VNodeFlags.Fragment) === 0) {
let nextSibling: Node | null = null;
// clear any other DOM nodes, there should be only a single entry for the root
if ((flags & VNodeFlags.Fragment) === 0) {
let nextSibling: Node | null = null;

while (currentNode) {
nextSibling = currentNode.nextSibling;
parentNode.removeChild(currentNode);
currentNode = nextSibling;
}
}
} else if (!isNull(parentNode.firstChild) && !isSamePropsInnerHTML(parentNode, props)) {
parentNode.textContent = ''; // dom has content, but VNode has no children remove everything from DOM
if (flags & VNodeFlags.FormElement) {
// If element is form element, we need to clear defaultValue also
(parentNode as any).defaultValue = '';
while (currentNode) {
nextSibling = currentNode.nextSibling;
parentNode.removeChild(currentNode);
currentNode = nextSibling;
}
}
}
Expand Down
Loading
Loading