Skip to content

Commit 619339e

Browse files
Merge pull request #98 from bluecadet/feature/eslint
Feature/eslint
2 parents 398cf9f + 60ad01f commit 619339e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+2714
-2682
lines changed

.changeset/silly-teachers-knock.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
"@bluecadet/launchpad-content": minor
3+
"@bluecadet/launchpad-dashboard": minor
4+
"@bluecadet/launchpad": minor
5+
"@bluecadet/launchpad-monitor": minor
6+
"@bluecadet/launchpad-scaffold": minor
7+
"@bluecadet/launchpad-utils": minor
8+
---
9+
10+
Added eslint and reformated code

.editorconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[*]
2+
charset = utf-8
3+
insert_final_newline = true
4+
trim_trailing_whitespace = false
5+
end_of_line = lf
6+
indent_style = tab
7+
tab_width = 2
8+
indent_size = 2
9+
max_line_length = 120

.eslintrc.json

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"extends": [
3+
"standard"
4+
],
5+
"rules": {
6+
"indent": [
7+
"error",
8+
"tab",
9+
{
10+
"SwitchCase": 1
11+
}
12+
],
13+
"no-tabs": ["off"],
14+
"no-unused-vars": "off",
15+
"semi": ["error", "always"],
16+
"brace-style": [
17+
"error",
18+
"1tbs",
19+
{
20+
"allowSingleLine": true
21+
}
22+
],
23+
"object-curly-spacing": ["error", "always"],
24+
"space-before-function-paren": [
25+
"error",
26+
{
27+
"anonymous": "never",
28+
"named": "never",
29+
"asyncArrow": "always"
30+
}
31+
],
32+
"no-trailing-spaces": [
33+
"error",
34+
{
35+
"skipBlankLines": true,
36+
"ignoreComments": true
37+
}
38+
]
39+
}
40+
}

.github/workflows/main.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Main
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened]
6+
branches:
7+
- develop
8+
- main
9+
10+
concurrency: ${{ github.workflow }}-${{ github.ref }}
11+
12+
jobs:
13+
lint:
14+
name: Lint
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v3
18+
- uses: actions/setup-node@v3
19+
with:
20+
node-version: 18.x
21+
22+
- name: Install Dependencies
23+
run: npm install
24+
25+
- name: Run eslint
26+
run: npm run lint

package.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@
1313
"download": "npm run content --",
1414
"test": "npm run test -w @bluecadet/launchpad -- ",
1515
"docs": "node .docs/generate.mjs",
16-
"watch-docs": "nodemon"
16+
"watch-docs": "nodemon",
17+
"lint": "npx eslint ./packages/**/*.js",
18+
"lint:fix": "npx eslint ./packages/**/*.js --fix",
19+
"lint:fix-dry": "npx eslint ./packages/**/*.js --fix-dry-run"
1720
},
1821
"repository": {
1922
"type": "git",
@@ -28,9 +31,11 @@
2831
"workspaces": [
2932
"./packages/*"
3033
],
31-
"dependencies": {
34+
"devDependencies": {
3235
"@changesets/changelog-github": "^0.4.6",
3336
"@changesets/cli": "^2.23.0",
37+
"eslint": "^8.32.0",
38+
"eslint-config-standard": "^17.0.0",
3439
"jsdoc-to-markdown": "^7.1.1",
3540
"nodemon": "^2.0.20"
3641
}

packages/content/index.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,21 @@ import { launchFromCli } from '@bluecadet/launchpad-utils';
55

66
export * from './lib/content-options.js';
77
export * from './lib/launchpad-content.js';
8-
export * from './lib/utils/file-utils.js'
8+
export * from './lib/utils/file-utils.js';
99
export default LaunchpadContent;
1010

1111
export const launch = async (config) => {
12-
const content = new LaunchpadContent(config.content || config);
13-
await content.start();
12+
const content = new LaunchpadContent(config.content || config);
13+
await content.start();
1414
};
1515

1616
launchFromCli(import.meta, {
17-
relativePaths: ["launchpad-content/index.js", ".bin/launchpad-content"],
17+
relativePaths: ['launchpad-content/index.js', '.bin/launchpad-content']
1818
})
19-
.then(launch)
20-
.catch((err) => {
21-
if (err) {
22-
console.error('Launch error', err);
23-
process.exit(1);
24-
}
25-
});
19+
.then(launch)
20+
.catch((err) => {
21+
if (err) {
22+
console.error('Launch error', err);
23+
process.exit(1);
24+
}
25+
});

0 commit comments

Comments
 (0)