NullVoxPopuli / eslint-configs

My Preferred ESLint configs for all my projects. Uses only overrides so that they're easy to maintain and update
9 stars 6 forks source link

upgrade breaks gjs support #608

Open billybonks opened 3 months ago

billybonks commented 3 months ago

i initally used this to simplify config for glimmerjs and eslint about 6months ago. Today i just mass upgraded all linters and got an error with GJS files.

I tried to pull your main branch but it didnt work either.

image

Version changes were as follows

image

my eslint config is

'use strict';

const { configs } = require('@nullvoxpopuli/eslint-configs');
let config = configs.ember();

module.exports = {
  ...config,
  overrides: [
    ...config.overrides,
    {
      files: ['**/*.js', '**/*.gjs'],
      rules: {
        'simple-import-sort/imports': 'off',
        'padding-line-between-statements': 'off',
      },
    },
  ],
};

Wondering if you know the issue? thanks for all the effort

billybonks commented 3 months ago

when i follow the guide and change my config to

// .eslintrc.js
const { configs } = require('@nullvoxpopuli/eslint-configs');
let config = configs.ember();

module.exports = {
  ...config,
  globals: {
    module: true,
    require: true,
    process: true,
  },
  overrides: [
    {
      files: ['**/*.{js,ts}'],
      plugins: ['ember'],
      parser: '@typescript-eslint/parser',
      extends: [
        'eslint:recommended',
        'plugin:ember/recommended', // or other configuration
      ],
      rules: {
        // override / enable optional rules
        'ember/no-replace-test-comments': 'error',
      },
    },
    {
      files: ['**/*.gts'],
      parser: 'ember-eslint-parser',
      plugins: ['ember'],
      extends: [
        'eslint:recommended',
        'plugin:@typescript-eslint/recommended',
        'plugin:ember/recommended',
        'plugin:ember/recommended-gts',
      ],
    },
    {
      files: ['**/*.gjs'],
      parser: 'ember-eslint-parser',
      plugins: ['ember'],
      extends: [
        'eslint:recommended',
        'plugin:ember/recommended',
        'plugin:ember/recommended-gjs',
      ],
    },
    {
      files: ['tests/**/*.{js,ts,gjs,gts}'],
      rules: {
        // override / enable optional rules
        'ember/no-replace-test-comments': 'error',
      },
    },
  ],
};

seems to work again

NullVoxPopuli commented 3 months ago

yeah that's what I've been doing in my own projects, too. Been waiting for all the dependencies of this config to support flat config so the next major can just be the flat config, and have all the other changes present as well