Skip to content

Commit 01b6ecc

Browse files
committed
Lint with Prettier
1 parent f48aed3 commit 01b6ecc

Some content is hidden

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

73 files changed

+14586
-10850
lines changed

.codeclimate.yml

+13-15
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
engines:
2-
eslint:
3-
enabled: true
4-
duplication:
5-
enabled: true
6-
config:
7-
languages:
8-
- javascript:
2+
eslint:
3+
enabled: true
4+
duplication:
5+
enabled: true
6+
config:
7+
languages:
8+
- javascript:
99
exclude_paths:
10-
- "docs/"
11-
- "dist/"
12-
- "build/"
13-
- "test/"
10+
- 'docs/'
11+
- 'dist/'
12+
- 'build/'
13+
- 'test/'
1414
ratings:
15-
paths:
16-
- "src/**/*"
17-
18-
15+
paths:
16+
- 'src/**/*'

.dependabot/config.yml

+14-14
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
version: 1
22

33
update_configs:
4-
# Keep package.json (& lockfiles) up to date
5-
# batching pull requests weekly
6-
- package_manager: "javascript"
7-
directory: "/"
8-
update_schedule: "weekly"
9-
automerged_updates:
10-
- match:
11-
# Supported dependency types:
12-
# - "development"
13-
# - "production"
14-
# - "all"
15-
dependency_type: "all"
16-
update_type: "semver:minor"
17-
version_requirement_updates: "increase_versions"
4+
# Keep package.json (& lockfiles) up to date
5+
# batching pull requests weekly
6+
- package_manager: 'javascript'
7+
directory: '/'
8+
update_schedule: 'weekly'
9+
automerged_updates:
10+
- match:
11+
# Supported dependency types:
12+
# - "development"
13+
# - "production"
14+
# - "all"
15+
dependency_type: 'all'
16+
update_type: 'semver:minor'
17+
version_requirement_updates: 'increase_versions'

.eslintrc.json

+12-7
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,17 @@
1616
}
1717
},
1818

19-
"extends": "eslint:recommended",
19+
"extends": [
20+
// Uses the recommended rules for Typescript
21+
"plugin:@typescript-eslint/recommended",
22+
// Disable rules that conflict with prettier
23+
// See https://prettier.io/docs/en/integrating-with-linters.html
24+
"plugin:prettier/recommended"
25+
],
2026
// See http://eslint.org/docs/rules/
2127

2228
"rules": {
23-
// Note:
29+
// Note:
2430
// "off" or 0 - turn the rule off
2531
// "warn" or 1 - turn the rule on as a warning (doesn’t affect exit code)
2632
// "error" or 2 - turn the rule on as an error (exit code is 1 when triggered)
@@ -41,7 +47,7 @@
4147
"valid-typeof": "error",
4248
"consistent-return": "error",
4349
"curly": ["warn", "multi-line"],
44-
"eqeqeq": ["error","smart"],
50+
"eqeqeq": ["error", "smart"],
4551
"guard-for-in": "warn",
4652
// "max-len": "warn",
4753
"new-cap": "warn",
@@ -64,9 +70,8 @@
6470
"no-delete-var": "warn",
6571
"no-mixed-spaces-and-tabs": ["warn", "smart-tabs"],
6672
"require-jsdoc": "off",
67-
"space-infix-ops": ["error", {"int32Hint": false}],
73+
"space-infix-ops": ["error", { "int32Hint": false }],
6874

69-
70-
"no-trailing-spaces": [1,{"skipBlankLines":true}]
75+
"no-trailing-spaces": [1, { "skipBlankLines": true }]
7176
}
72-
}
77+
}

.github/ISSUE_TEMPLATE.md

+11-6
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,40 @@
11
## Prerequisites
22

3-
* [ ] New issue
4-
[Did you check the [issue tracker](https://github.com/arnog/mathlive/issues) to see if this issue has already been reported? If it has, you can +1 it to indicate your interest and be notified when it gets resolved.]
3+
- [ ] New issue
4+
[Did you check the [issue tracker](https://github.com/arnog/mathlive/issues) to see if this issue has already been reported? If it has, you can +1 it to indicate your interest and be notified when it gets resolved.]
55

66
[For more information, see the `CONTRIBUTING` guide.]
77

88
## Description
9+
910
[Description of the bug or feature.]
1011

1112
[Include screenshots or code fragments if applicable]
1213

1314
### Actual behavior
15+
1416
[What actually happened]
1517

16-
[If there are any error messages, include the exact text shown,
18+
[If there are any error messages, include the exact text shown,
1719
or upload a screenshot. Some error messages may displayed in the Javascript console.]
1820

19-
### Expected Behavior
21+
### Expected Behavior
22+
2023
[What you expected to happen]
2124

2225
[Is this a regression: did it use to work in a previous version?]
2326

2427
## Steps to Reproduce
28+
2529
[Provide steps that are specific and repeatable, if possible]
30+
2631
1. [First Step]
2732
2. [Second Step]
2833
3. [and so on...]
2934

30-
3135
### Environment
32-
**Operating System**
36+
37+
**Operating System**
3338
[macOS, Windows, iOS. Include the version if possible]
3439

3540
**Browser** [Safari, Chrome, IE, Firefox, etc...]

.github/ISSUE_TEMPLATE/bug_report.md

+9-10
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,24 @@
11
---
2+
23
name: Bug report
34
about: Create a report to help us improve
45
title: ''
56
labels: ''
67
assignees: ''
8+
---**Funding**
79

8-
---
9-
10-
**Funding**
11-
> If you're using MathLive consider donating to project development via [Patreon](https://patreon.com/arnog) (recurring donation) or [PayPal](https://www.paypal.me/arnogourdol) (one time donation).
10+
> If you're using MathLive consider donating to project development via [Patreon](https://patreon.com/arnog) (recurring donation) or [PayPal](https://www.paypal.me/arnogourdol) (one time donation).
1211

1312
> Issues submitted by funding partners are given higher priority.
1413

1514
> We welcome both individual and corporate sponsors. In addition to Patreon and PayPal, we can also accept short-term development contracts for specific features or maintenance of the project.
1615

17-
1816
**Describe the bug**
1917
A clear and concise description of what the bug is.
2018

2119
**To Reproduce**
2220
[Steps to reproduce the behavior, for example:]
21+
2322
1. [Go to '...']
2423
2. [Click on '....']
2524
3. [Scroll down to '....']
@@ -36,9 +35,9 @@ A clear and concise description of what the bug is.
3635
**Source Code**
3736
[If applicable, provide a code sample demonstrating the issue. Use JSFiddle, CodePen or similar to provide a relevant snippet.]
3837

39-
4038
**Environment**
41-
- Device: [pc, mac, iPhone, Android...]
42-
- OS: [e.g. iOS]
43-
- Browser [e.g. chrome, safari]
44-
- Version [e.g. 22]
39+
40+
- Device: [pc, mac, iPhone, Android...]
41+
- OS: [e.g. iOS]
42+
- Browser [e.g. chrome, safari]
43+
- Version [e.g. 22]

.travis.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ install: [npm ci]
55
cache:
66
directories:
77
- node_modules
8-
- "$HOME/.npm"
8+
- '$HOME/.npm'
99
branches:
1010
only:
1111
- master
@@ -18,8 +18,8 @@ deploy:
1818
provider: npm
1919
on:
2020
tags: true
21-
email: "$NPM_EMAIL"
22-
api_token: "$NPM_API_TOKEN"
21+
email: '$NPM_EMAIL'
22+
api_token: '$NPM_API_TOKEN'
2323
access: public
2424
# dry_run: true
2525
edge: true
@@ -31,7 +31,7 @@ notifications:
3131
secure: dctz771vJCv6UdjBz65n8XkKx5q/LF5UIY+qSRAxLpqwFp9Y3i9trUNoSaDya4PH5sfAHbUHxsBvG8njIKDJY1pckcrCt2Ml2+9fRQ01cCMggNnSK5OlcuoL6lrnbMbaLz3XEUKJY8mfJnnHggUFNqT0IhCR4xgcxiyg90AtHhIGQcIpkFrpmwbW+ZXm7PMTP/svGkL3OMs4lDO6V8XzEGKXd+4rkcvINZwOtKDXbIf7Wm5MXQ2lf4o1DviAJeFqlIUPRRonAs2KPUAl86t+M22EWDExy6NOtmbdA68m+pDaBJ0mMN0OwxsoEJh5e7ml1/UAs82hCu+Kl3xW4emDrrF7k6C065NmWeRqLBVJxcfy+rdNsiBfJhPmBBGc0VTYLqnWR5PLxDBHgLyO7zAjG4n4G8WpCEY0j891Xaw3Cktz8tWWo336BxCmsd2zOUdoWr+aQsml25mlpLYuX2t4HR66jJdz8A7X+e5m4V3/BE+afMKhRYgeuwPVq03TBAtHZp5jLr0TCw9t3qyNrUEXGtqoAYdCThCP1zcpxTTYnxoYHgoEfiE8OVMkMf6R3JpCUQMk1+AbpyVIHeCxfaq7jCZjUG4exMGFNFhTSjl3ePoCLdwfP75uEIiQU/LOJGb2JrJWVjTEBs5P/atk71ijomygAU3D6BtYwoZm0Hqy+l8=
3232
webhooks:
3333
urls:
34-
- "$GITTER_URL"
34+
- '$GITTER_URL'
3535
on_success: change # options: [always|never|change] default: always
3636
on_failure: always # options: [always|never|change] default: always
3737
on_start: never # options: [always|never|change] default: always

.vscode/launch.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@
1919
"webRoot": "${workspaceFolder}"
2020
}
2121
]
22-
}
22+
}

.vscode/settings.json

+5-9
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
{
22
"eslint.provideLintTask": true,
33
"eslint.options": {
4-
"configFile":".eslintrc.json"
4+
"configFile": ".eslintrc.json"
55
},
66
"cSpell.allowCompoundWords": true,
7-
"cSpell.words": [
8-
"assistive",
9-
"grapheme",
10-
"latexify",
11-
"mathrm"
12-
],
13-
"search.usePCRE2": true
14-
}
7+
"cSpell.words": ["assistive", "grapheme", "latexify", "mathrm"],
8+
"search.usePCRE2": true,
9+
"cSpell.enabled": false
10+
}

.vscode/tasks.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
// See https://go.microsoft.com/fwlink/?LinkId=733558
2+
// See https://go.microsoft.com/fwlink/?LinkId=733558
33
// for the documentation about the tasks.json format
44
"version": "2.0.0",
55
"tasks": [
@@ -9,4 +9,4 @@
99
"problemMatcher": []
1010
}
1111
]
12-
}
12+
}

CHANGELOG.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ Now, a shortcut can be defined with some pre-conditions. It is still possible to
238238

239239
```javascript
240240
config.inlineShortcuts = {
241-
in: "\\in"
241+
in: '\\in',
242242
};
243243
```
244244

@@ -247,10 +247,10 @@ However, a shortcut can now be specified with an object:
247247
```javascript
248248
config.inlineShortcuts = {
249249
in: {
250-
mode: "math",
251-
after: "space+letter+digit+symbol+fence",
252-
value: "\\in"
253-
}
250+
mode: 'math',
251+
after: 'space+letter+digit+symbol+fence',
252+
value: '\\in',
253+
},
254254
};
255255
```
256256

@@ -397,10 +397,10 @@ The `'after'` key, if present, indicate in what context the shortcut should appl
397397
argument of the handlers now refers to the mathfield to which it applies.
398398

399399
```javascript
400-
MathLive.makeMathField("input", {
400+
MathLive.makeMathField('input', {
401401
onContentDidChange: mf => {
402-
document.getElementById("output").innerHTML = mf.latex();
403-
}
402+
document.getElementById('output').innerHTML = mf.latex();
403+
},
404404
});
405405
```
406406

@@ -441,7 +441,7 @@ but it is recommended to use native JavaScript modules:
441441

442442
```html
443443
<script type="module">
444-
import MathLive from "../../dist/mathlive.mjs";
444+
import MathLive from '../../dist/mathlive.mjs';
445445
</script>
446446
```
447447

@@ -476,7 +476,7 @@ Instead of:
476476
use:
477477
478478
```javascript
479-
import MathLive from "../../dist/src/mathlive.js";
479+
import MathLive from '../../dist/src/mathlive.js';
480480
MathLive.makeMathField(/*...*/);
481481
```
482482

CODE_OF_CONDUCT.md

+13-13
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,22 @@ orientation.
1414
Examples of behavior that contributes to creating a positive environment
1515
include:
1616

17-
* Using welcoming and inclusive language
18-
* Being respectful of differing viewpoints and experiences
19-
* Gracefully accepting constructive criticism
20-
* Focusing on what is best for the community
21-
* Showing empathy towards other community members
17+
- Using welcoming and inclusive language
18+
- Being respectful of differing viewpoints and experiences
19+
- Gracefully accepting constructive criticism
20+
- Focusing on what is best for the community
21+
- Showing empathy towards other community members
2222

2323
Examples of unacceptable behavior by participants include:
2424

25-
* The use of sexualized language or imagery and unwelcome sexual attention or
26-
advances
27-
* Trolling, insulting/derogatory comments, and personal or political attacks
28-
* Public or private harassment
29-
* Publishing others' private information, such as a physical or electronic
30-
address, without explicit permission
31-
* Other conduct which could reasonably be considered inappropriate in a
32-
professional setting
25+
- The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
- Trolling, insulting/derogatory comments, and personal or political attacks
28+
- Public or private harassment
29+
- Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
- Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
3333

3434
## Our Responsibilities
3535

0 commit comments

Comments
 (0)