Eslint не работает с ионным и конденсатором (Android/iOS) - javaScript Heap Out из памятиJavascript

Форум по Javascript
Ответить Пред. темаСлед. тема
Anonymous
 Eslint не работает с ионным и конденсатором (Android/iOS) - javaScript Heap Out из памяти

Сообщение Anonymous »

Я работаю над ионным угловым проектом с конденсатором, и я сталкиваюсь с проблемой, в которой Eslint не работает должным образом. Когда я запускаю Eslint в своем проекте, он не удается со следующей ошибкой: < /p>
FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
< /code>
Я подозреваю, что проблема связана с тем, как Eslint обрабатывает файлы в папках Android, iOS и www, поскольку эти каталоги содержат большое количество файлов.
Когда я удалял Android, iOS и WWW папку, а затем npm запустить команду Lint, выполненное успешное.• Framework: Ionic Angular
• Linting Setup: "eslint": "9.24.0",
• Capacitor Version: 7.x
• Node Version: 20.18.0
< /code>
Что я попробовал < /p>
1. Increasing Heap Memory:

• Ran ESLint with more memory:(NODE_OPTIONS="--max_old_space_size=4096" eslint "src/**/*.{js,jsx,ts,tsx,html}" --fix)
• Still getting the same error.

2. Ignoring Large Directories:

• Added the following to .eslintignore:
android/ , ios/ , www/ , node_modules/
< /code>
Мой пакет файл json - < /p>
{
"name": "cj-web-portal",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve --port 4205",
"build": "ng build",
"build:dev": "node --max_old_space_size=5048 ./node_modules/@angular/cli/bin/ng build --configuration development --aot --output-hashing=all",
"build:stag": "node --max_old_space_size=5048 ./node_modules/@angular/cli/bin/ng build --configuration staging --aot --output-hashing=all",
"build:uat": "node --max_old_space_size=5048 ./node_modules/@angular/cli/bin/ng build --configuration uat --aot --output-hashing=all",
"build:prod": "node --max_old_space_size=5048 ./node_modules/@angular/cli/bin/ng build --configuration production --aot --output-hashing=all",
"watch": "ng build --watch --configuration development",
"test": "ng test",
"lint": "eslint \"src/**/*.{js,jsx,ts,tsx,html}\" --fix",
"prepare": "husky",
"pretty-quick": "pretty-quick --staged",
"build:android": "ng build && npx cap copy android && npx cap open android",
"build:ios": "ng build && npx cap copy ios && npx cap open ios"
},
"lint-staged": {
"src/**/*.{js,jsx,ts,tsx,html}": "eslint --fix"
},
"private": true,
"dependencies": {
"@abacritt/angularx-social-login": "2.1.0",
"@angular/animations": "^19.0.5",
"@angular/cdk": "^19.2.7",
"@angular/common": "^19.0.5",
"@angular/compiler": "^19.0.5",
"@angular/core": "^19.0.5",
"@angular/forms": "^19.0.5",
"@angular/platform-browser": "^19.0.5",
"@angular/platform-browser-dynamic": "^19.0.5",
"@angular/pwa": "^19.0.6",
"@angular/router": "^19.0.5",
"@angular/service-worker": "^19.0.6",
"@capacitor/android": "^7.1.0",
"@capacitor/app": "7.0.0",
"@capacitor/barcode-scanner": "^2.0.3",
"@capacitor/cli": "^7.1.0",
"@capacitor/core": "7.2.0",
"@capacitor/device": "^7.0.0",
"@capacitor/haptics": "7.0.0",
"@capacitor/ios": "^7.2.0",
"@capacitor/keyboard": "7.0.0",
"@capacitor/splash-screen": "^7.0.0",
"@capacitor/status-bar": "^7.0.0",
"@capawesome/capacitor-android-edge-to-edge-support": "^7.1.0",
"@ionic/angular": "^8.5.2",
"@ngx-translate/core": "^16.0.4",
"@stripe/stripe-js": "~2.4.0",
"bootstrap": "^5.3.2",
"chart.js": "^4.4.3",
"crypto-js": "^4.2.0",
"date-fns": "^3.4.0",
"dayjs": "^1.11.10",
"jquery": "^3.7.1",
"line-awesome": "^1.3.0",
"ng-recaptcha": "^13.2.1",
"ngx-color-picker": "^16.0.0",
"ngx-daterangepicker-bootstrap": "^19.5.2",
"ngx-drag-drop": "^17.0.0",
"ngx-infinite-scroll": "^19.0.0",
"ngx-monaco-editor-v2": "^18.1.0",
"ngx-paypal": "^11.0.0",
"ngx-scanner-qrcode": "1.6.9",
"ngx-slick-carousel": "^19.0.0",
"ngx-spinner": "^16.0.2",
"ngx-stars": "^1.6.5",
"ngx-stripe": "~17.0.0",
"pkce-challenge": "^4.1.0",
"primeng": "^17.10.0",
"quill": "~1.3.7",
"rxjs": "~7.8.0",
"slick-carousel": "^1.8.1",
"tslib": "^2.3.0",
"zone.js": "~0.15.0"
},
"devDependencies": {
"@angular-devkit/build-angular": "^19.0.6",
"@angular-eslint/builder": "19.0.2",
"@angular-eslint/eslint-plugin": "19.0.2",
"@angular-eslint/eslint-plugin-template": "19.0.2",
"@angular-eslint/schematics": "19.0.2",
"@angular-eslint/template-parser": "19.0.2",
"@angular/cli": "^19.0.6",
"@angular/compiler-cli": "^19.0.5",
"@capacitor/cli": "7.2.0",
"@eslint/eslintrc": "3.3.1",
"@eslint/js": "9.24.0",
"@types/jasmine": "~5.1.0",
"@typescript-eslint/eslint-plugin": "8.29.1",
"@typescript-eslint/parser": "8.29.1",
"eslint": "9.24.0",
"husky": "9.1.7",
"jasmine-core": "~5.1.0",
"karma": "~6.4.0",
"karma-chrome-launcher": "~3.2.0",
"karma-coverage": "~2.2.0",
"karma-jasmine": "~5.1.0",
"karma-jasmine-html-reporter": "~2.1.0",
"lint-staged": "15.5.0",
"pretty-quick": "^4.0.0",
"typescript": "~5.5.4"
}
}

< /code>
my eslint.config.mjs файл < /p>
import { defineConfig, globalIgnores } from 'eslint/config';
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 defineConfig([
globalIgnores([
'projects/**/*',
'**/package.json',
'**/package-lock.json',
'**/www',
'**/ios',
'**/android',
'www/**/*',
'ios/**/*',
'android/**/*',
'**/ionic.config.json',
'e2e/**/*',
'**/karma.conf.js',
'**/commitlint.config.js',
]),
{
ignores: [
'projects/**/*',
'**/package.json',
'**/package-lock.json',
'**/www',
'**/ios',
'**/android',
'www/**/*',
'ios/**/*',
'android/**/*',
'**/ionic.config.json',
'e2e/**/*',
'**/karma.conf.js',
'**/commitlint.config.js',
],
},
{
files: ['**/*.ts'],

extends: compat.extends('eslint:recommended', 'plugin:@angular-eslint/recommended', 'plugin:@angular-eslint/template/process-inline-templates'),

languageOptions: {
ecmaVersion: 5,
sourceType: 'script',

parserOptions: {
project: ['tsconfig.json', 'e2e/tsconfig.json'],
createDefaultProgram: true,
},
},

rules: {
'@angular-eslint/directive-selector': [
'error',
{
type: 'attribute',
prefix: 'app',
style: 'camelCase',
},
],

eqeqeq: ['error', 'always'],
semi: ['error', 'always'],
'@angular-eslint/no-empty-lifecycle-method': 'off',
'@angular-eslint/use-lifecycle-interface': 'off',
'@angular-eslint/component-selector': 'off',
'no-empty': 'off',
'no-undef': 'off',
'no-unused-vars': 'off',
'@angular-eslint/prefer-standalone': 'off',
},
},
{
files: ['**/*.html'],

extends: compat.extends('plugin:@angular-eslint/template/recommended', 'plugin:@angular-eslint/template/accessibility'),

rules: {
'@angular-eslint/template/label-has-associated-control': 'off',
'@angular-eslint/template/elements-content': 'off',
'@angular-eslint/template/click-events-have-key-events': 'off',
'@angular-eslint/template/interactive-supports-focus': 'off',
},
},
]);



Подробнее здесь: https://stackoverflow.com/questions/795 ... t-heap-out
Реклама
Ответить Пред. темаСлед. тема

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

  • Похожие темы
    Ответы
    Просмотры
    Последнее сообщение
  • Как использовать библиотеку Watermarkjs с ионным конденсатором?
    Anonymous » » в форуме Android
    0 Ответы
    14 Просмотры
    Последнее сообщение Anonymous
  • Как упаковать размещенное веб -приложение с ионным конденсатором
    Anonymous » » в форуме Android
    0 Ответы
    2 Просмотры
    Последнее сообщение Anonymous
  • Разница между "On-Heap" и "Off-Heap"
    Anonymous » » в форуме JAVA
    0 Ответы
    5 Просмотры
    Последнее сообщение Anonymous
  • Разница между "On-Heap" и "Off-Heap"
    Anonymous » » в форуме JAVA
    0 Ответы
    5 Просмотры
    Последнее сообщение Anonymous
  • OpenTeLemetry-CPP тестовый приложение работает, но тот же код в Times Out Out Out
    Anonymous » » в форуме C++
    0 Ответы
    4 Просмотры
    Последнее сообщение Anonymous

Вернуться в «Javascript»