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

feature/pre commit #175

Merged
merged 51 commits into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from 44 commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
8c18020
Add pre-commit, ESLint, prettier
joshua-dean Sep 27, 2024
dbdadb3
Switch to husky as it's output is nicer
joshua-dean Sep 27, 2024
d2ebc3d
Include prettier in husky pre-commit
joshua-dean Sep 27, 2024
477be00
Some better settings for linting/formatting
joshua-dean Sep 27, 2024
b6c4010
Fix eslint issues in `src/index.js`
joshua-dean Sep 27, 2024
c7888c0
Format `src/index.js` with prettier
joshua-dean Sep 27, 2024
c7a5ac2
Switch to indent of 4 spaces
joshua-dean Sep 27, 2024
bcfb4ac
Add rule for `package.json` in `.editorconfig`
joshua-dean Sep 27, 2024
915a963
Auto-fix eslint issues in `src/toolbox.ts`
joshua-dean Sep 27, 2024
7e8684b
Fix eslint complaints in `src/toolbox.ts`
joshua-dean Sep 27, 2024
6a71bd2
Format `src/toolbox.ts` with prettier
joshua-dean Sep 27, 2024
b4be8bc
Toggle on `sort-imports`
joshua-dean Sep 30, 2024
2095c8a
Sort imports in `src/index.js`
joshua-dean Sep 30, 2024
af3539b
Revert formatting changes.
joshua-dean Oct 1, 2024
21ceb19
Update packages and config for stylistic
joshua-dean Oct 1, 2024
5506824
Configure a few more rules
joshua-dean Oct 1, 2024
439ee90
Temporarily nuke pre-commit
joshua-dean Oct 1, 2024
55eab67
Fix eslint complaints in `src/toolbox.ts`
joshua-dean Sep 27, 2024
39819a3
Stylistic formatting
joshua-dean Oct 1, 2024
3a6d00c
Revert "Stylistic formatting"
joshua-dean Oct 1, 2024
e587692
Update to use shared config
joshua-dean Oct 1, 2024
d6cab45
Tweak semi rule
joshua-dean Oct 1, 2024
f5f7680
Enforce 1tbs
joshua-dean Oct 1, 2024
c2a2f7b
Formatting using new config
joshua-dean Oct 1, 2024
cd55a3d
Format with latest rules
joshua-dean Oct 1, 2024
d1ad5ae
Updated operator-linebreak rule
joshua-dean Oct 1, 2024
f770571
Automatic ESLint fixes
joshua-dean Oct 3, 2024
3b1b0b0
Add eslint back to lint-staged
joshua-dean Oct 3, 2024
7178400
Manually fixed issues in `utilities.ts`
joshua-dean Oct 3, 2024
20ea6cf
Manually correct issues in `subtask.ts`
joshua-dean Oct 3, 2024
fc2ebc8
Added typescript annotations for jquery
joshua-dean Oct 3, 2024
d9e9310
Fix type issues in `index.d.ts`
joshua-dean Oct 3, 2024
9983f7d
Fix issues in `html_builder.ts`
joshua-dean Oct 3, 2024
8914d19
Fix build issues by expanding JQuery event type
joshua-dean Oct 3, 2024
d875ab6
Manually fix issues in `geometric_utils.ts`
joshua-dean Oct 3, 2024
ed1c022
Fix issues in `drawing_utilities.ts`
joshua-dean Oct 3, 2024
7ced715
Fix ESLint complaints in `configuration.ts`
joshua-dean Oct 3, 2024
eddd9ad
Fix ESLint issues in `annotation_operators.ts`
joshua-dean Oct 3, 2024
73e2079
Fix ESLint issues in `annotation.ts`
joshua-dean Oct 3, 2024
6eaa12b
Merge branch 'main' into feature/pre-commit
joshua-dean Oct 3, 2024
fb0331d
Bump minor to v0.15.0
joshua-dean Oct 3, 2024
bb794f1
Update README and changelog
joshua-dean Oct 3, 2024
7602592
Change CHANGELOG to uppercase
joshua-dean Oct 3, 2024
4baa459
Build v0.15.0
joshua-dean Oct 3, 2024
1cbc446
Bring back `.editorconfig`
joshua-dean Oct 4, 2024
219377c
Region disable for no-multi-spaces
joshua-dean Oct 4, 2024
c1200fd
Add note on abstract construct signatures
joshua-dean Oct 4, 2024
56193d6
Remove unecessary comments
joshua-dean Oct 4, 2024
96be736
Update src/geometric_utils.ts
joshua-dean Oct 4, 2024
9df8c40
Update src/geometric_utils.ts
joshua-dean Oct 4, 2024
44af16a
Semicolon member-delimiter-style
joshua-dean Oct 4, 2024
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
17 changes: 0 additions & 17 deletions .eslintrc.json

This file was deleted.

1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx lint-staged
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.prettierignore
.husky
build
dist
node_modules
1 change: 1 addition & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
3 changes: 3 additions & 0 deletions changelog.md → CHANGELOG.md
joshua-dean marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ All notable changes to this project will be documented here.

Nothing yet.

## [0.15.0] - Oct 3rd, 2024
- Added [ESLint](https://eslint.org/) to enforce code quality and consistency

## [0.14.1] - Oct 2nd, 2024
- Add a `brush-button-active` CSS class to the "brush" and "erase" buttons
that visually depicts when the brush or erase tool is active
Expand Down
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,15 @@ The repository ships with the built `dist/ulabel.js` file. This file is not to b
npm run build
```

### Linting and Formatting

Linting and formatting are performed by [ESLint](https://eslint.org/)
with the following plugins:
- [typescript-eslint](https://typescript-eslint.io/)
- [ESLint Stylistic](https://eslint.style/)

Git hooks are run by [husky](https://typicode.github.io/husky/).

## Attribution

The three demo images were downloaded from the [CityScapes dataset](https://www.cityscapes-dataset.com/). In particular, they are sampled from the first few frames of the `leftImg8bit_demoVideo`.
2 changes: 1 addition & 1 deletion dist/ulabel.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/ulabel.min.js

Large diffs are not rendered by default.

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

export default [
{
// Global ignores
// https://eslint.org/docs/latest/use/configure/configuration-files#configuration-objects
ignores: [
"node_modules",
"dist",
"build",
"demo.js",
"webpack.config.js",
],
},
{
files: ["**/*.{js,mjs,cjs,ts}"],
languageOptions: {
globals: globals.browser,
},
},
stylistic.configs.customize(
{
braceStyle: "1tbs",
commaDangle: "always-multiline",
indent: 4,
quotes: "double",
},
),
{
plugins: {
"@stylistic": stylistic,
},
rules: {
"@stylistic/array-element-newline": [
"error",
{
consistent: true,
multiline: true,
},
],
"@stylistic/function-call-argument-newline": ["error", "consistent"],
"@stylistic/function-call-spacing": ["error", "never"],
"@stylistic/operator-linebreak": ["error", "after"],
"@stylistic/semi": ["error", "always"],
},

},
eslint.configs.recommended,
...tseslint.configs.recommended,
];
Loading