Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
- Fix eslint warnings
  • Loading branch information
maroontress-tomohisa committed Feb 6, 2025
1 parent 2384fc2 commit fded74d
Show file tree
Hide file tree
Showing 7 changed files with 4,075 additions and 6,359 deletions.
9 changes: 0 additions & 9 deletions .eslintrc.js

This file was deleted.

4 changes: 3 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,6 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Run eslint
run: npx eslint index.js
run: |
npm install
npx eslint index.js
6,013 changes: 3,486 additions & 2,527 deletions dist/index.js

Large diffs are not rendered by default.

42 changes: 42 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import globals from 'globals';
import js from '@eslint/js';
import stylisticJs from '@stylistic/eslint-plugin-js';

const commonRules = {
'@stylistic/js/max-len': ['error', { 'code': 80 }],
'prefer-const': 'warn',
'line-comment-position': ['warn', { 'position': 'above' }],
'camelcase': 'warn',
'no-const-assign': 'warn',
'no-this-before-super': 'warn',
'no-undef': 'warn',
'no-unreachable': 'warn',
'no-unused-vars': 'warn',
'constructor-super': 'warn',
'valid-typeof': 'warn',
};

export default [
js.configs.recommended,
{
files: ['*.js'],
plugins: {
'@stylistic/js': stylisticJs
},
languageOptions: {
sourceType: 'commonjs',
globals: {
...globals.node,
...globals.es2021,
}
},
rules: commonRules,
},
{
ignores: [
'.*/**/*',
'dist/**/*',
'node_modules/**/*',
'*.config.mjs']
}
];
8 changes: 4 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const child_process = require('child_process');
const childProcess = require('child_process');
const core = require('@actions/core');
const fs = require('fs');
const os = require('os');
Expand Down Expand Up @@ -44,7 +44,7 @@ try {
const knownHostsFile = path.join(homeDotSshDir, 'known_hosts');
fs.writeFileSync(knownHostsFile, GITHUB_COM + os.EOL);
console.log(`${knownHostsFile}: created`);
let sshConfigList = [];
const sshConfigList = [];
for (let k = 0; k < n; ++k) {
const keyLines = allKeys[k].trim()
.split(/\r?\n/);
Expand Down Expand Up @@ -72,7 +72,7 @@ try {
return;
}

child_process.execSync(
childProcess.execSync(
`ssh-keygen -y -f ${keyFile} > ${publicKeyFile}`);
console.log(`${publicKeyFile}: created`);
const data = fs.readFileSync(publicKeyFile, { encoding: 'utf8' });
Expand All @@ -94,7 +94,7 @@ try {
const url = comment.slice(0, -COMMENT_POSTFIX.length);
const pathOfUrl = url.slice(COMMENT_PREFIX.length);
const newUrl = `git@${fakeHost}:${pathOfUrl}`;
child_process.execSync(
childProcess.execSync(
`git config --global url.${newUrl}.insteadOf ${url}`);
sshConfigList.push(`Host ${fakeHost}`,
' HostName github.com',
Expand Down
Loading

0 comments on commit fded74d

Please sign in to comment.