Skip to content

Commit

Permalink
move .eslintrc.js to .eslintrc to fix issues... (#1233)
Browse files Browse the repository at this point in the history
* move .eslintrc.js to .eslintrc to fix issues with using import in .mjs files

Signed-off-by: Nick Boldt <nboldt@redhat.com>

remove eslint-disable now that we can use it for .mjs modules

Signed-off-by: Nick Boldt <nboldt@redhat.com>

* switch to Paul's solution for removing millis; allow prettier to run on ./scripts/*.mjs now that the eslint config is
fixed

Signed-off-by: Nick Boldt <nboldt@redhat.com>

---------

Signed-off-by: Nick Boldt <nboldt@redhat.com>
  • Loading branch information
nickboldt authored May 6, 2024
1 parent dd858d2 commit 5287a75
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
7 changes: 7 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"root": true,
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
}
}
3 changes: 0 additions & 3 deletions .eslintrc.js

This file was deleted.

2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm run lint-staged
npm run versions:metadata
npm run lint-staged
1 change: 0 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@ coverage
*.yaml
.yarn
packages/app/src/build-metadata.json
scripts/update-backstage.mjs
2 changes: 1 addition & 1 deletion packages/app/src/build-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"card": [
"RHDH Version: 1.2.0",
"Backstage Version: 1.25.2",
"Last Commit: 2024-05-03T14:19:20Z"
"Last Commit: 2024-05-06T13:23:08Z"
]
}
3 changes: 1 addition & 2 deletions scripts/update-backstage.mjs
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
/* eslint-disable */
import glob from 'glob';
import { execSync } from 'node:child_process';
import { existsSync, readFileSync, readdirSync, writeFileSync } from 'node:fs';
import { dirname, join } from 'node:path';
import { fileURLToPath } from 'node:url';
import semver from 'semver';
import { updateBuildMetadata } from './update-metadata.mjs'
import { updateBuildMetadata } from './update-metadata.mjs';

const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
Expand Down
6 changes: 2 additions & 4 deletions scripts/update-metadata.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable */
import { execSync } from 'node:child_process';
import { readFileSync, writeFileSync } from 'node:fs';
import { dirname, join } from 'node:path';
import { fileURLToPath } from 'node:url';
Expand Down Expand Up @@ -28,8 +26,8 @@ export function updateBuildMetadata(backstageVersion) {
readFileSync('package.json', 'utf8'),
).version.toString();

const commitTime = new Date().toISOString() // 2024-05-03T12:12:08.174Z
const commitTime = new Date().toISOString().slice(0, -5) + 'Z'; // eg., 2024-05-03T12:12:08Z

const card = [
`RHDH Version: ${rhdhVersion}`,
`Backstage Version: ${backstageVersion}`,
Expand Down

0 comments on commit 5287a75

Please # to comment.