Skip to content
This repository has been archived by the owner on Dec 2, 2022. It is now read-only.

Use overrides so that a single .eslintrc.js is sufficient #595

Open
buschtoens opened this issue Feb 9, 2021 · 0 comments
Open

Use overrides so that a single .eslintrc.js is sufficient #595

buschtoens opened this issue Feb 9, 2021 · 0 comments

Comments

@buschtoens
Copy link
Member

'use strict';

// @TODO this can be removed once `trailingComma` is enabled upstream by default
const prettierTrailingComma = {
  'prettier/prettier': [
    'error',
    require('@clark/prettier-config/trailing-comma'),
  ],
};

// @TODO this can be removed once the following is fixed
// https://github.com/mysticatea/eslint-plugin-node/issues/77
const fixNoUnpublishedRequire = {
  'node/no-unpublished-require': 'off',
};

module.exports = {
  root: true,
  overrides: [
    {
      files: ['app/**/*.{js,ts}', 'tests/**/*.{js,ts}', 'types/**/*.{js,ts}'],
      extends: '@clark/ember-typescript',
      rules: { ...prettierTrailingComma },
    },
    {
      files: ['public/**/*.js', 'vendor/**/*.js'],
      extends: '@clark/browser',
      rules: { ...prettierTrailingComma },
    },
    {
      files: [
        './*.js',
        'blueprints/*/index.js',
        'config/**/*.js',
        'lib/*/index.js',
        'server/**/*.js',
      ],
      extends: '@clark/node',
      rules: {
        ...prettierTrailingComma,
        ...fixNoUnpublishedRequire,
      },
    },
  ],
};
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant