Skip to content

Commit d83c353

Browse files
Fix lint
1 parent 7319f36 commit d83c353

13 files changed

Lines changed: 57 additions & 106 deletions

File tree

.template-lintrc.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ module.exports = {
55
rules: {
66
// TODO: fix these and enable octane
77
'no-action': false,
8+
'no-at-ember-render-modifiers': false,
9+
'no-builtin-form-components': false,
810
'no-curly-component-invocation': false,
911
'no-implicit-this': false,
1012
'no-inline-styles': false,

blueprints/docs-page/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-env node */
21
const path = require('path');
32
const fs = require('fs');
43
const chalk = require('chalk');
@@ -11,6 +10,7 @@ const DUMMY_APP_PATH = path.join('tests', 'dummy', 'app');
1110
function dedasherize(str) {
1211
let dedasherized = str.replace(/-/g, ' ');
1312

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

config/deploy.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
/* eslint-env node */
2-
31
module.exports = function (deployTarget) {
42
let ENV = {
53
build: {},

eslint.config.mjs

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,14 @@ export default [
4343
* https://eslint.org/docs/latest/use/configure/ignore
4444
*/
4545
{
46-
ignores: ['dist/', 'node_modules/', 'coverage/', 'test-apps/', '!**/.*'],
46+
ignores: [
47+
'dist/',
48+
'node_modules/',
49+
'coverage/',
50+
'test-apps/',
51+
'tmp/',
52+
'!**/.*',
53+
],
4754
},
4855
/**
4956
* https://eslint.org/docs/latest/use/configure/configuration-files#configuring-linter-options
@@ -65,8 +72,25 @@ export default [
6572
parserOptions: esmParserOptions,
6673
globals: {
6774
...globals.browser,
75+
server: true,
6876
},
6977
},
78+
rules: {
79+
'no-unused-vars': ['error', { args: 'none' }],
80+
'no-console': ['error', { allow: ['warn', 'error'] }],
81+
'ember/no-incorrect-calls-with-inline-anonymous-functions': 'off',
82+
'ember/require-return-from-computed': 'off',
83+
'ember/no-jquery': 'error',
84+
85+
// TODO: enable these rules
86+
'ember/classic-decorator-no-classic-methods': 'off',
87+
'ember/no-classic-classes': 'off',
88+
'ember/no-classic-components': 'off',
89+
'ember/no-component-lifecycle-hooks': 'off',
90+
'ember/no-computed-properties-in-native-classes': 'off',
91+
'ember/no-private-routing-service': 'off',
92+
'ember/no-runloop': 'off',
93+
},
7094
},
7195
{
7296
files: ['tests/**/*-test.{js,gjs}'],
@@ -80,13 +104,19 @@ export default [
80104
{
81105
files: [
82106
'**/*.cjs',
107+
'blueprints/*/index.js',
83108
'config/**/*.js',
109+
'lib/**/*.js',
110+
'sandbox/index.js',
111+
'tests/dummy/config/**/*.js',
84112
'testem.js',
85113
'testem*.js',
86114
'.prettierrc.js',
87115
'.stylelintrc.js',
88116
'.template-lintrc.js',
117+
'**/addon-docs.js',
89118
'ember-cli-build.js',
119+
'index.js',
90120
],
91121
plugins: {
92122
n,
@@ -100,6 +130,24 @@ export default [
100130
},
101131
},
102132
},
133+
/**
134+
* Node test files (mocha)
135+
*/
136+
{
137+
files: ['tests-node/**/*.js'],
138+
plugins: {
139+
n,
140+
},
141+
142+
languageOptions: {
143+
sourceType: 'script',
144+
ecmaVersion: 'latest',
145+
globals: {
146+
...globals.node,
147+
...globals.mocha,
148+
},
149+
},
150+
},
103151
/**
104152
* ESM node files
105153
*/

index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ const path = require('path');
55
const UnwatchedDir = require('broccoli-source').UnwatchedDir;
66
const MergeTrees = require('broccoli-merge-trees');
77
const Funnel = require('broccoli-funnel');
8-
const EmberApp = require('ember-cli/lib/broccoli/ember-app'); // eslint-disable-line n/no-unpublished-require
9-
const Plugin = require('broccoli-plugin');
8+
const EmberApp = require('ember-cli/lib/broccoli/ember-app');
9+
const BroccoliPlugin = require('broccoli-plugin');
1010
const walkSync = require('walk-sync');
1111

1212
const LATEST_VERSION_NAME = '-latest';
@@ -463,7 +463,7 @@ function generateDefaultProject(parentAddon, addonSrcFolder) {
463463
return new MergeTrees(includeFunnels);
464464
}
465465

466-
class FindDummyAppFiles extends Plugin {
466+
class FindDummyAppFiles extends BroccoliPlugin {
467467
build() {
468468
let addonPath = this.inputPaths[0];
469469
let paths = walkSync(addonPath, { directories: false });
@@ -476,7 +476,7 @@ class FindDummyAppFiles extends Plugin {
476476
}
477477
}
478478

479-
class FindAddonFiles extends Plugin {
479+
class FindAddonFiles extends BroccoliPlugin {
480480
build() {
481481
let addonPath = this.inputPaths[0];
482482
let paths = addonPath ? walkSync(addonPath, { directories: false }) : [];

lib/utils/find-and-replace-in-directory.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
/* eslint-disable no-console */
2-
31
'use strict';
42

53
const fs = require('fs-extra');

sandbox/.eslintrc.js

Lines changed: 0 additions & 49 deletions
This file was deleted.

sandbox/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ module.exports = {
66

77
isDevelopingAddon() {
88
return true;
9-
}
9+
},
1010
};

test-apps/new-addon/.eslintignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

test-apps/new-addon/.eslintrc.js

Lines changed: 0 additions & 42 deletions
This file was deleted.

0 commit comments

Comments
 (0)