autocomplete-json icon indicating copy to clipboard operation
autocomplete-json copied to clipboard

Crashes Atom when opening a .eslintrc.json file

Open nelson6e65 opened this issue 3 years ago • 4 comments

When I open my ESLint config, Atom crashes.

This is the content of my .eslintrc.json:

{
  "root": true,
  "extends": [],
  "overrides": [
    {
      "files": ["*.js"],
      "extends": ["eslint:recommended", "plugin:node/recommended", "prettier"]
    },
    {
      "files": ["*.ts"],
      "settings": {
        "import/parsers": {
          "@typescript-eslint/parser": [".ts"]
        },
        "import/resolver": {
          "typescript": {
            "alwaysTryTypes": true,
            "project": ["tsconfig.json", "e2e/tsconfig.json", "scripts/tsconfig.json", "src/tsconfig.json"]
          }
        }
      },
      "parserOptions": {
        "project": ["tsconfig.json", "e2e/tsconfig.json", "scripts/tsconfig.json", "src/tsconfig.json"],
        "createDefaultProgram": true
      },
      "extends": [
        "eslint:recommended",
        "plugin:@typescript-eslint/recommended",
        "plugin:@angular-eslint/recommended",
        "plugin:@angular-eslint/ng-cli-compat",
        "plugin:@angular-eslint/ng-cli-compat--formatting-add-on",
        "plugin:@angular-eslint/template/process-inline-templates",
        "plugin:import/errors",
        "plugin:import/warnings",
        "plugin:import/typescript",
        "prettier"
      ],
      "plugins": ["@typescript-eslint", "@angular-eslint", "import"],
      "rules": {
        "id-blacklist": ["warn"],
        "arrow-body-style": ["error", "as-needed", { "requireReturnForObjectLiteral": true }],
        "prefer-arrow-callback": "error",
        "@typescript-eslint/no-use-before-define": "error",
        "@typescript-eslint/member-ordering": [
          "warn",
          {
            "default": [
              "signature",
              "abstract-field",
              "abstract-method",
              "private-static-field",
              "protected-static-field",
              "public-static-field",
              "private-instance-field",
              "protected-instance-field",
              "public-instance-field",
              "private-decorated-field",
              "protected-decorated-field",
              "public-decorated-field",
              "field",
              "public-constructor",
              "protected-constructor",
              "private-constructor",
              "constructor",
              "private-static-method",
              "protected-static-method",
              "public-static-method",
              "private-instance-method",
              "protected-instance-method",
              "public-instance-method",
              "private-decorated-method",
              "protected-decorated-method",
              "public-decorated-method",
              "private-method",
              "protected-method",
              "public-method",
              "static-method",
              "instance-method",
              "decorated-method",
              "method"
            ]
          }
        ],
        "@typescript-eslint/naming-convention": [
          "warn",
          {
            "selector": "default",
            "format": ["camelCase"],
            "leadingUnderscore": "allow",
            "trailingUnderscore": "allow"
          },
          {
            "selector": "variable",
            "format": ["camelCase", "UPPER_CASE"],
            "leadingUnderscore": "allow",
            "trailingUnderscore": "allow"
          },
          {
            "selector": "typeLike",
            "format": ["PascalCase"]
          },
          {
            "selector": "enumMember",
            "format": ["PascalCase"]
          }
        ],
        "@typescript-eslint/no-shadow": ["error"],
        "@typescript-eslint/type-annotation-spacing": "off",
        "@typescript-eslint/explicit-member-accessibility": [
          "warn",
          {
            "accessibility": "explicit"
          }
        ],
        "@angular-eslint/component-class-suffix": [
          "error",
          {
            "suffixes": ["Page", "Component"]
          }
        ],
        "@angular-eslint/component-selector": [
          "warn",
          {
            "type": "element",
            "prefix": "app",
            "style": "kebab-case"
          }
        ],
        "@angular-eslint/directive-selector": [
          "error",
          {
            "type": "attribute",
            "prefix": "app",
            "style": "camelCase"
          }
        ],
        "@angular-eslint/no-empty-lifecycle-method": "warn",
        "import/no-unassigned-import": "warn",
        "import/newline-after-import": ["warn", { "count": 2 }],
        "import/order": [
          "error",
          {
            "alphabetize": {
              "order": "asc",
              "caseInsensitive": false
            },
            "newlines-between": "always-and-inside-groups",
            "groups": ["builtin", "external", "parent", "sibling", "index"]
          }
        ],
        "no-underscore-dangle": [
          "warn",
          {
            "allowAfterThis": true
          }
        ],
        "prefer-template": "error"
      }
    },
    {
      "files": ["*.html"],
      "extends": ["plugin:@angular-eslint/template/recommended", "prettier"],
      "rules": {}
    }
  ]
}

nelson6e65 avatar Apr 20 '22 08:04 nelson6e65

I am not able to reproduce this. What version of Atom and os?

UziTech avatar Apr 24 '22 04:04 UziTech

Windows 11

Atom    : 1.60.0
Electron: 9.4.4
Chrome  : 83.0.4103.122
Node    : 12.14.1

nelson6e65 avatar Apr 24 '22 07:04 nelson6e65

That is my same setup. Is it possible it is a different package that I don't have installed?

UziTech avatar Apr 24 '22 15:04 UziTech

I installed this package, but I used for other files, so I did not notice this error for a week until edited my ESLint config.

At first, I thought it was an ESLint issue, but by switching on/off the packages, I find out the problem was with this ON.

I think I only have prettier and linter-json-eslint running on my JSON files.

Click to see my installed packages
Community Packages (68) C:\Users\Nelson Martell\.atom\packages
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] (disabled)
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] (disabled)
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] (disabled)
├── [email protected] (disabled)
├── [email protected]
├── [email protected] (disabled)
├── [email protected] (disabled)
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] (disabled)
├── [email protected]
├── [email protected] (disabled)
├── [email protected] (disabled)
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] (disabled)
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] (disabled)
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected]

nelson6e65 avatar Apr 24 '22 19:04 nelson6e65