Skip to content

Commit 861695e

Browse files
authored
Merge pull request #124 from umbraco/feature/lint-staged
Fix eslint paths + ignore hbs
2 parents f6af71d + ad43669 commit 861695e

File tree

4 files changed

+29
-29
lines changed

4 files changed

+29
-29
lines changed

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.hbs

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919
"custom-elements"
2020
],
2121
"scripts": {
22-
"lint:eslint": "eslint --ext .ts,.html . --ignore-path .gitignore",
23-
"format:eslint": "eslint --ext .ts,.html . --fix --ignore-path .gitignore",
24-
"lint:prettier": "prettier \"**/*.js\" \"**/*.ts\" --check --ignore-path .gitignore",
25-
"format:prettier": "prettier \"**/*.js\" \"**/*.ts\" --write --ignore-path .gitignore",
22+
"lint:eslint": "eslint --ext .ts,.html,.mjs,.cjs . --ignore-path .gitignore",
23+
"format:eslint": "eslint --ext .ts,.html,.mjs,.cjs . --fix --ignore-path .gitignore",
24+
"lint:prettier": "prettier \"**/*.js\" \"**/*.ts\" \"**/*.mjs\" --check --ignore-path .gitignore",
25+
"format:prettier": "prettier \"**/*.js\" \"**/*.ts\" \"**/*.mjs\" --write --ignore-path .gitignore",
2626
"lint": "npm run lint:eslint && npm run lint:prettier",
2727
"format": "npm run format:eslint && npm run format:prettier",
2828
"storybook": "npm run bootstrap && npm run storybook:analyze && start-storybook -p 6006 -s ./.storybook/images",
@@ -113,8 +113,8 @@
113113
"./packages/*"
114114
],
115115
"lint-staged": {
116-
"**/*.ts": "tsc-files --project tsconfig-lint-staged.json",
117-
"**/*.{mjs}": "eslint --cache --fix -c .eslintrc.js",
116+
"*.ts": "tsc-files --project tsconfig-lint-staged.json",
117+
"*.{js,ts,mjs,cjs,html}": "eslint --cache --fix -c .eslintrc.js",
118118
"*": "prettier --ignore-unknown --write"
119119
}
120120
}

scripts/lerna-fix.mjs

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,25 @@
11
import fs from 'fs';
22
import path from 'path';
33

4-
54
function main() {
6-
const folder = fs.realpathSync('.');
7-
const pkg = readPackageJson(folder);
8-
if (pkg.gitHead) {
9-
const fpath = path.join(folder, 'package.json');
10-
console.debug(`Deleting gitHead from ${fpath}...`);
11-
delete pkg.gitHead;
12-
fs.writeFileSync(fpath, JSON.stringify(pkg, null, 2) + '\n');
13-
}
14-
}
15-
16-
function readJsonFile(fpath) {
17-
const content = fs.readFileSync(fpath);
18-
return JSON.parse(content);
19-
}
20-
21-
function readPackageJson(folder) {
22-
const packageJsonPath = path.join(folder, 'package.json');
23-
return readJsonFile(packageJsonPath);
5+
const folder = fs.realpathSync('.');
6+
const pkg = readPackageJson(folder);
7+
if (pkg.gitHead) {
8+
const fpath = path.join(folder, 'package.json');
9+
console.debug(`Deleting gitHead from ${fpath}...`);
10+
delete pkg.gitHead;
11+
fs.writeFileSync(fpath, JSON.stringify(pkg, null, 2) + '\n');
2412
}
25-
26-
main();
13+
}
14+
15+
function readJsonFile(fpath) {
16+
const content = fs.readFileSync(fpath);
17+
return JSON.parse(content);
18+
}
19+
20+
function readPackageJson(folder) {
21+
const packageJsonPath = path.join(folder, 'package.json');
22+
return readJsonFile(packageJsonPath);
23+
}
24+
25+
main();

web-test-runner.config.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ import { esbuildPlugin } from '@web/dev-server-esbuild';
33
export default {
44
nodeResolve: true,
55
files: 'packages/**/*.test.ts',
6-
plugins: [esbuildPlugin({ ts: true, target: 'auto' })]
7-
};
6+
plugins: [esbuildPlugin({ ts: true, target: 'auto' })],
7+
};

0 commit comments

Comments
 (0)