Skip to content

Commit

Permalink
Sync lint configs
Browse files Browse the repository at this point in the history
  • Loading branch information
NullVoxPopuli committed Jun 12, 2022
1 parent 28b24a4 commit 4179486
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 53 deletions.
57 changes: 9 additions & 48 deletions test-app/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,58 +1,19 @@
'use strict';

const { configs } = require('@nullvoxpopuli/eslint-configs');

// accommodates: JS, TS, App, and Addon
const config = configs.ember();

module.exports = {
root: true,
parser: 'babel-eslint',
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
ecmaFeatures: {
legacyDecorators: true,
},
},
plugins: ['ember'],
extends: [
'eslint:recommended',
'plugin:ember/recommended',
'plugin:prettier/recommended',
],
env: {
browser: true,
},
rules: {},
...config,
overrides: [
// node files
...config.overrides,
{
files: [
'./.eslintrc.js',
'./.prettierrc.js',
'./.template-lintrc.js',
'./ember-cli-build.js',
'./testem.js',
'./blueprints/*/index.js',
'./config/**/*.js',
'./lib/*/index.js',
'./server/**/*.js',
],
parserOptions: {
sourceType: 'script',
},
env: {
browser: false,
node: true,
},
plugins: ['node'],
extends: ['plugin:node/recommended'],
files: ['**/*.js', '**/*.ts'],
rules: {
// this can be removed once the following is fixed
// https://github.com/mysticatea/eslint-plugin-node/issues/77
'node/no-unpublished-require': 'off',
'prettier/prettier': ['error', require('./.prettierrc')],
},
},
{
// test files
files: ['tests/**/*-test.{js,ts}'],
extends: ['plugin:qunit/recommended'],
},
],
};
7 changes: 4 additions & 3 deletions test-app/tests/test-helper.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import Application from 'test-app/app';
import config from 'test-app/config/environment';
import * as QUnit from 'qunit';
import { setApplication } from '@ember/test-helpers';
import * as QUnit from 'qunit';
import { setup } from 'qunit-dom';
import { start } from 'ember-qunit';

import Application from 'test-app/app';
import config from 'test-app/config/environment';

setApplication(Application.create(config.APP));

setup(QUnit.assert);
Expand Down
2 changes: 1 addition & 1 deletion test-app/types/global.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Types for compiled templates
declare module 'test-app/templates/*' {
import { TemplateFactory } from 'htmlbars-inline-precompile';
import type { TemplateFactory } from 'htmlbars-inline-precompile';
const tmpl: TemplateFactory;
export default tmpl;
}
2 changes: 1 addition & 1 deletion test-app/types/test-app/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Ember from 'ember';
import type Ember from 'ember';

declare global {
// Prevents ESLint from "fixing" this via its auto-fix to turn it into a type
Expand Down

0 comments on commit 4179486

Please sign in to comment.