Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(docs-app): Use new standards library #226

Merged
merged 4 commits into from
Oct 23, 2024
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
14 changes: 0 additions & 14 deletions apps/docs-app/.eslintignore

This file was deleted.

101 changes: 0 additions & 101 deletions apps/docs-app/.eslintrc.js

This file was deleted.

4 changes: 2 additions & 2 deletions apps/docs-app/app/components/f/form/index.gts
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ export default class extends Component {
@tracked
required = true;

constructor() {
super(...arguments);
constructor(...args: unknown[]) {
super(...args);
this.model = new Model();

setOwner(this.model, getOwner(this));
Expand Down
1 change: 1 addition & 0 deletions apps/docs-app/config/ember-try.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
'use strict';
/* eslint-disable @typescript-eslint/no-require-imports */

const { embroiderSafe, embroiderOptimized } = require('@embroider/test-setup');
const getChannelURL = require('ember-source-channel-url');
Expand Down
15 changes: 8 additions & 7 deletions apps/docs-app/ember-cli-build.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
'use strict';
/* eslint-disable @typescript-eslint/no-require-imports */

const EmberApp = require('ember-cli/lib/broccoli/ember-app');
const fs = require('fs');
Expand All @@ -7,27 +8,27 @@ const path = require('path');
module.exports = async function (defaults) {
const { readPackageUpSync } = await import('read-package-up');

let app = new EmberApp(defaults, {
const app = new EmberApp(defaults, {
minifyCSS: {
enabled: false,
},
'ember-cli-babel': { enableTypeScriptTransform: true },
trees: {
app: (() => {
let sideWatch = require('@embroider/broccoli-side-watch');
const sideWatch = require('@embroider/broccoli-side-watch');

let paths = ['@nrg-ui/core', '@nrg-ui/css'].map((libraryName) => {
let entry = require.resolve(libraryName);
let { packageJson, path: packageJsonPath } = readPackageUpSync({
const paths = ['@nrg-ui/core', '@nrg-ui/css'].map((libraryName) => {
const entry = require.resolve(libraryName);
const { packageJson, path: packageJsonPath } = readPackageUpSync({
cwd: entry,
});
let packagePath = path.dirname(packageJsonPath);
const packagePath = path.dirname(packageJsonPath);

console.debug(
`Side-watching ${libraryName} from ${packagePath}, which started in ${entry}`,
);

let toWatch = packageJson.files
const toWatch = packageJson.files
.map((f) => path.join(packagePath, f))
.filter((p) => {
if (!fs.existsSync(p)) return false;
Expand Down
29 changes: 29 additions & 0 deletions apps/docs-app/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { eslint, merge } from '@nrg-ui/standards';

export default await merge(
eslint.rules.ignore([
'/blueprints/*/files/',
'/coverage/',
'!.*',
'.*/',
'/.node_modules.ember-try/',
]),
eslint.rules.base(),
eslint.rules.js(),
eslint.rules.ts(),
eslint.rules.gjs(),
eslint.rules.gts(),
eslint.rules.scripts([
'./.eslintrc.js',
'./.prettierrc.js',
'./.stylelintrc.js',
'./.template-lintrc.js',
'./ember-cli-build.js',
'./testem.js',
'./blueprints/*/index.js',
'./config/**/*.js',
'./lib/*/index.js',
'./server/**/*.js',
]),
eslint.rules.tests(),
);
11 changes: 5 additions & 6 deletions apps/docs-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"@glint/template": "^1.4.0",
"@nrg-ui/core": "workspace:*",
"@nrg-ui/css": "workspace:*",
"@nrg-ui/standards": "workspace:*",
"@tsconfig/ember": "^3.0.8",
"@types/ember": "^4.0.11",
"@types/ember-data": "^4.4.16",
Expand Down Expand Up @@ -71,8 +72,6 @@
"@types/ember__utils": "^4.0.7",
"@types/qunit": "^2.19.10",
"@types/rsvp": "^4.0.9",
"@typescript-eslint/eslint-plugin": "^6.21.0",
"@typescript-eslint/parser": "^6.21.0",
"broccoli-asset-rev": "^3.0.0",
"concurrently": "^8.2.2",
"ember-auto-import": "^2.7.3",
Expand Down Expand Up @@ -100,15 +99,14 @@
"ember-template-imports": "^4.1.1",
"ember-template-lint": "^5.13.0",
"ember-try": "^3.0.0",
"eslint": "^8.57.0",
"eslint": "^9.13.0",
"eslint-config-prettier": "^9.1.0",
"eslint-import-resolver-webpack": "^0.13.8",
"eslint-plugin-decorator-position": "^5.0.2",
"eslint-plugin-ember": "^12.1.1",
"eslint-plugin-ember": "^12.2.0",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-n": "^16.6.2",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-qunit": "^8.1.1",
"eslint-plugin-qunit": "^8.1.2",
"loader.js": "^4.7.0",
"prettier": "^3.3.1",
"qunit": "^2.21.0",
Expand All @@ -119,6 +117,7 @@
"stylelint-prettier": "^4.1.0",
"tracked-built-ins": "^3.3.0",
"typescript": "^5.4.5",
"typescript-eslint": "^8.11.0",
"webpack": "^5.93.0"
},
"engines": {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
},
"pnpm": {
"overrides": {
"@types/eslint": "^7.0.0",
"@types/eslint": "^9.6.1",
"eslint-plugin-ember": "^12.2.1"
}
}
Expand Down
1 change: 1 addition & 0 deletions packages/standards/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,6 @@ Since this package uses ESLint v9, various plugins have a minimum version requir
| `eslint-plugin-ember` | `^12.2.0` |
| `eslint-plugin-import` | `^2.31.0` |
| `eslint-plugin-n` | `^16.0.0` |
| `eslint-plugin-qunit` | `^8.1.2` |

\* The `eslint-plugin-decorator-position` does not currently have formal support for ESLint v9. However, it is still compatible with this package. As new versions are released, the compatibility will be updated.
1 change: 1 addition & 0 deletions packages/standards/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"execa": "^9.3.0"
},
"devDependencies": {
"@types/eslint": "^9.6.1",
"@types/node": "^22.7.6",
"eslint": "^9.13.0",
"eslint-plugin-decorator-position": "^5.0.2",
Expand Down
Loading
Loading