Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions .eslintignore

This file was deleted.

94 changes: 0 additions & 94 deletions .eslintrc.js

This file was deleted.

3 changes: 1 addition & 2 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
/.ember-cli
/.env*
/.eslintcache
/.eslintignore
/.eslintrc.js
/.git/
/.github/
/.gitignore
Expand All @@ -20,6 +18,7 @@
/.watchmanconfig
/CONTRIBUTING.md
/ember-cli-build.js
/eslint.config.mjs
/testem.js
/tests/
/tsconfig.declarations.json
Expand Down
10 changes: 9 additions & 1 deletion .prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
'use strict';

module.exports = {
plugins: ['prettier-plugin-ember-template-tag'],
overrides: [
{
files: '*.{js,ts}',
files: '*.{js,gjs,ts,gts,mjs,mts,cjs,cts}',
options: {
singleQuote: true,
},
},
{
files: '*.{gjs,gts}',
options: {
singleQuote: true,
templateSingleQuote: false,
},
},
],
};
2 changes: 2 additions & 0 deletions .template-lintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ module.exports = {
rules: {
// TODO: fix these and enable octane
'no-action': false,
'no-at-ember-render-modifiers': false,
'no-builtin-form-components': false,
'no-curly-component-invocation': false,
'no-implicit-this': false,
'no-inline-styles': false,
Expand Down
2 changes: 1 addition & 1 deletion blueprints/docs-page/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-env node */
const path = require('path');
const fs = require('fs');
const chalk = require('chalk');
Expand All @@ -11,6 +10,7 @@ const DUMMY_APP_PATH = path.join('tests', 'dummy', 'app');
function dedasherize(str) {
let dedasherized = str.replace(/-/g, ' ');

// eslint-disable-next-line ember/no-string-prototype-extensions
return stringUtil.capitalize(dedasherized);
}

Expand Down
2 changes: 0 additions & 2 deletions config/deploy.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-env node */

module.exports = function (deployTarget) {
let ENV = {
build: {},
Expand Down
169 changes: 169 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
/**
* Debugging:
* https://eslint.org/docs/latest/use/configure/debug
* ----------------------------------------------------
*
* Print a file's calculated configuration
*
* npx eslint --print-config path/to/file.js
*
* Inspecting the config
*
* npx eslint --inspect-config
*
*/
import globals from 'globals';
import js from '@eslint/js';

import ember from 'eslint-plugin-ember/recommended';
import prettier from 'eslint-plugin-prettier/recommended';
import qunit from 'eslint-plugin-qunit';
import n from 'eslint-plugin-n';

import babelParser from '@babel/eslint-parser';

const esmParserOptions = {
ecmaFeatures: { modules: true },
ecmaVersion: 'latest',
requireConfigFile: false,
babelOptions: {
plugins: [
['@babel/plugin-proposal-decorators', { decoratorsBeforeExport: true }],
],
},
};

export default [
js.configs.recommended,
prettier,
ember.configs.base,
ember.configs.gjs,
/**
* Ignores must be in their own object
* https://eslint.org/docs/latest/use/configure/ignore
*/
{
ignores: [
'dist/',
'node_modules/',
'coverage/',
'test-apps/',
'tmp/',
'!**/.*',
],
},
/**
* https://eslint.org/docs/latest/use/configure/configuration-files#configuring-linter-options
*/
{
linterOptions: {
reportUnusedDisableDirectives: 'error',
},
},
{
files: ['**/*.js'],
languageOptions: {
parser: babelParser,
},
},
{
files: ['**/*.{js,gjs}'],
languageOptions: {
parserOptions: esmParserOptions,
globals: {
...globals.browser,
server: true,
},
},
rules: {
'no-unused-vars': ['error', { args: 'none' }],
'no-console': ['error', { allow: ['warn', 'error'] }],
'ember/no-incorrect-calls-with-inline-anonymous-functions': 'off',
'ember/require-return-from-computed': 'off',
'ember/no-jquery': 'error',

// TODO: enable these rules
'ember/classic-decorator-no-classic-methods': 'off',
'ember/no-classic-classes': 'off',
'ember/no-classic-components': 'off',
'ember/no-component-lifecycle-hooks': 'off',
'ember/no-computed-properties-in-native-classes': 'off',
'ember/no-private-routing-service': 'off',
'ember/no-runloop': 'off',
},
},
{
files: ['tests/**/*-test.{js,gjs}'],
plugins: {
qunit,
},
},
/**
* CJS node files
*/
{
files: [
'**/*.cjs',
'blueprints/*/index.js',
'config/**/*.js',
'lib/**/*.js',
'sandbox/index.js',
'tests/dummy/config/**/*.js',
'testem.js',
'testem*.js',
'.prettierrc.js',
'.stylelintrc.js',
'.template-lintrc.js',
'**/addon-docs.js',
'ember-cli-build.js',
'index.js',
],
plugins: {
n,
},

languageOptions: {
sourceType: 'script',
ecmaVersion: 'latest',
globals: {
...globals.node,
},
},
},
/**
* Node test files (mocha)
*/
{
files: ['tests-node/**/*.js'],
plugins: {
n,
},

languageOptions: {
sourceType: 'script',
ecmaVersion: 'latest',
globals: {
...globals.node,
...globals.mocha,
},
},
},
/**
* ESM node files
*/
{
files: ['**/*.mjs'],
plugins: {
n,
},

languageOptions: {
sourceType: 'module',
ecmaVersion: 'latest',
parserOptions: esmParserOptions,
globals: {
...globals.node,
},
},
},
];
8 changes: 4 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ const path = require('path');
const UnwatchedDir = require('broccoli-source').UnwatchedDir;
const MergeTrees = require('broccoli-merge-trees');
const Funnel = require('broccoli-funnel');
const EmberApp = require('ember-cli/lib/broccoli/ember-app'); // eslint-disable-line n/no-unpublished-require
const Plugin = require('broccoli-plugin');
const EmberApp = require('ember-cli/lib/broccoli/ember-app');
const BroccoliPlugin = require('broccoli-plugin');
const walkSync = require('walk-sync');

const LATEST_VERSION_NAME = '-latest';
Expand Down Expand Up @@ -463,7 +463,7 @@ function generateDefaultProject(parentAddon, addonSrcFolder) {
return new MergeTrees(includeFunnels);
}

class FindDummyAppFiles extends Plugin {
class FindDummyAppFiles extends BroccoliPlugin {
build() {
let addonPath = this.inputPaths[0];
let paths = walkSync(addonPath, { directories: false });
Expand All @@ -476,7 +476,7 @@ class FindDummyAppFiles extends Plugin {
}
}

class FindAddonFiles extends Plugin {
class FindAddonFiles extends BroccoliPlugin {
build() {
let addonPath = this.inputPaths[0];
let paths = addonPath ? walkSync(addonPath, { directories: false }) : [];
Expand Down
2 changes: 0 additions & 2 deletions lib/utils/find-and-replace-in-directory.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable no-console */

'use strict';

const fs = require('fs-extra');
Expand Down
Loading
Loading