Skip to content

Commit 5addb36

Browse files
committed
Apply prettier to most code
1 parent fed50a0 commit 5addb36

36 files changed

+313
-349
lines changed

.eslintrc.cjs

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,12 @@
11
module.exports = {
22
root: true,
33
parser: '@typescript-eslint/parser',
4-
ignorePatterns: [
5-
'/docs/',
6-
'/dist/',
7-
],
8-
plugins: [
9-
'@typescript-eslint',
10-
],
11-
extends: [
12-
'eslint:recommended',
13-
],
4+
ignorePatterns: ['/docs/', '/dist/'],
5+
plugins: ['@typescript-eslint'],
6+
extends: ['eslint:recommended'],
147
rules: {
158
semi: 'error',
169
'quote-props': ['error', 'as-needed'],
17-
quotes: ['error', 'single'],
1810
// For SSR compatibility
1911
'no-restricted-globals': [
2012
'error',
@@ -35,9 +27,7 @@ module.exports = {
3527
overrides: [
3628
{
3729
files: ['*.ts'],
38-
extends: [
39-
'plugin:@typescript-eslint/recommended',
40-
],
30+
extends: ['plugin:@typescript-eslint/recommended'],
4131
},
4232
{
4333
files: ['*.js'],
@@ -58,9 +48,7 @@ module.exports = {
5848
images: 'readonly',
5949
},
6050
rules: {
61-
'no-restricted-globals': [
62-
'off',
63-
],
51+
'no-restricted-globals': ['off'],
6452
},
6553
},
6654
],

.github/workflows/codeql-analysis.yml

Lines changed: 53 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -3,69 +3,69 @@
33
#
44
# You may wish to alter this file to override the set of languages analyzed,
55
# or to provide custom queries or build logic.
6-
name: "CodeQL"
6+
name: 'CodeQL'
77

88
on:
9-
push:
10-
branches: [master]
11-
pull_request:
12-
# The branches below must be a subset of the branches above
13-
branches: [master]
14-
schedule:
15-
- cron: '0 10 * * 5'
9+
push:
10+
branches: [master]
11+
pull_request:
12+
# The branches below must be a subset of the branches above
13+
branches: [master]
14+
schedule:
15+
- cron: '0 10 * * 5'
1616

1717
jobs:
18-
analyze:
19-
name: Analyze
20-
runs-on: ubuntu-latest
18+
analyze:
19+
name: Analyze
20+
runs-on: ubuntu-latest
2121

22-
strategy:
23-
fail-fast: false
24-
matrix:
25-
# Override automatic language detection by changing the below list
26-
# Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python']
27-
language: ['javascript']
28-
# Learn more...
29-
# https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection
22+
strategy:
23+
fail-fast: false
24+
matrix:
25+
# Override automatic language detection by changing the below list
26+
# Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python']
27+
language: ['javascript']
28+
# Learn more...
29+
# https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection
3030

31-
steps:
32-
- name: Checkout repository
33-
uses: actions/checkout@v3
34-
with:
35-
# We must fetch at least the immediate parents so that if this is
36-
# a pull request then we can checkout the head.
37-
fetch-depth: 2
31+
steps:
32+
- name: Checkout repository
33+
uses: actions/checkout@v3
34+
with:
35+
# We must fetch at least the immediate parents so that if this is
36+
# a pull request then we can checkout the head.
37+
fetch-depth: 2
3838

39-
# If this run was triggered by a pull request event, then checkout
40-
# the head of the pull request instead of the merge commit.
41-
- run: git checkout HEAD^2
42-
if: ${{ github.event_name == 'pull_request' }}
39+
# If this run was triggered by a pull request event, then checkout
40+
# the head of the pull request instead of the merge commit.
41+
- run: git checkout HEAD^2
42+
if: ${{ github.event_name == 'pull_request' }}
4343

44-
# Initializes the CodeQL tools for scanning.
45-
- name: Initialize CodeQL
46-
uses: github/codeql-action/init@v2
47-
with:
48-
languages: ${{ matrix.language }}
49-
# If you wish to specify custom queries, you can do so here or in a config file.
50-
# By default, queries listed here will override any specified in a config file.
51-
# Prefix the list here with "+" to use these queries and those in the config file.
52-
# queries: ./path/to/local/query, your-org/your-repo/queries@main
44+
# Initializes the CodeQL tools for scanning.
45+
- name: Initialize CodeQL
46+
uses: github/codeql-action/init@v2
47+
with:
48+
languages: ${{ matrix.language }}
49+
# If you wish to specify custom queries, you can do so here or in a config file.
50+
# By default, queries listed here will override any specified in a config file.
51+
# Prefix the list here with "+" to use these queries and those in the config file.
52+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
5353

54-
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
55-
# If this step fails, then you should remove it and run the build manually (see below)
56-
- name: Autobuild
57-
uses: github/codeql-action/autobuild@v2
54+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
55+
# If this step fails, then you should remove it and run the build manually (see below)
56+
- name: Autobuild
57+
uses: github/codeql-action/autobuild@v2
5858

59-
# ℹ️ Command-line programs to run using the OS shell.
60-
# 📚 https://git.io/JvXDl
59+
# ℹ️ Command-line programs to run using the OS shell.
60+
# 📚 https://git.io/JvXDl
6161

62-
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
63-
# and modify them (or add more) to build your code if your project
64-
# uses a compiled language
62+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
63+
# and modify them (or add more) to build your code if your project
64+
# uses a compiled language
6565

66-
#- run: |
67-
# make bootstrap
68-
# make release
66+
#- run: |
67+
# make bootstrap
68+
# make release
6969

70-
- name: Perform CodeQL Analysis
71-
uses: github/codeql-action/analyze@v2
70+
- name: Perform CodeQL Analysis
71+
uses: github/codeql-action/analyze@v2

.github/workflows/main.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,14 @@ jobs:
3636
cache: 'yarn'
3737
- run: yarn --frozen-lockfile
3838
- run: yarn lint
39+
40+
prettier:
41+
runs-on: ubuntu-latest
42+
steps:
43+
- uses: actions/checkout@v3
44+
- uses: actions/setup-node@v3
45+
with:
46+
node-version: '18'
47+
cache: 'yarn'
48+
- run: yarn --frozen-lockfile
49+
- run: ./node_modules/.bin/prettier --check .

.prettierignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/.git/
2+
/.idea/
3+
/node_modules/
4+
/docs/

.prettierrc.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"$schema": "http://json.schemastore.org/prettierrc",
3+
"tabWidth": 4,
4+
"singleQuote": true,
5+
"trailingComma": "all",
6+
"printWidth": 120,
7+
"arrowParens": "avoid",
8+
"bracketSpacing": false
9+
}

README.md

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
Natural Gallery JS
2-
============================
1+
# Natural Gallery JS
32

43
[![Build Status](https://github.com/Ecodev/natural-gallery-js/workflows/main/badge.svg)](https://github.com/Ecodev/natural-gallery-js/actions)
54

@@ -9,13 +8,12 @@ A library that allows you to display images with with natural layouts, infinite
98

109
[![screenshot](https://ecodev.github.io/natural-gallery-js/assets/screenshot.png)](https://ecodev.github.io/natural-gallery-js/)
1110

12-
1311
# Documentation
14-
* [Getting started](https://ecodev.github.io/natural-gallery-js/docs-getting-started.html)
15-
* [Options](https://ecodev.github.io/natural-gallery-js/docs-options.html)
16-
* [Api and events](https://ecodev.github.io/natural-gallery-js/docs-api.html)
17-
* [Theming and customization](https://ecodev.github.io/natural-gallery-js/docs-theming.html)
1812

13+
- [Getting started](https://ecodev.github.io/natural-gallery-js/docs-getting-started.html)
14+
- [Options](https://ecodev.github.io/natural-gallery-js/docs-options.html)
15+
- [Api and events](https://ecodev.github.io/natural-gallery-js/docs-api.html)
16+
- [Theming and customization](https://ecodev.github.io/natural-gallery-js/docs-theming.html)
1917

2018
# Install with NPM or Yarn
2119

@@ -33,11 +31,11 @@ All contributions are welcome, but keep in mind that the gallery will stay simpl
3331

3432
## Found a bug ?
3533

36-
Create an issue where you report what you observe, what you expect to observe, and the context of usage, as well as your browser and it's version.
34+
Create an issue where you report what you observe, what you expect to observe, and the context of usage, as well as your browser and it's version.
3735

3836
## Want a new feature ?
3937

40-
Consider a pull request, but create an issue before to expose your idea. Maybe the feature you would like to add is already on the pipeline or is intentionally not included for good reasons.
38+
Consider a pull request, but create an issue before to expose your idea. Maybe the feature you would like to add is already on the pipeline or is intentionally not included for good reasons.
4139

4240
# Testing
4341

babel.config.cjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ module.exports = {
33
test: {
44
presets: [
55
[
6-
"@babel/preset-env",
6+
'@babel/preset-env',
77
{
88
targets: {
9-
node: "current",
9+
node: 'current',
1010
},
1111
},
1212
],

docs/assets/natural-gallery-js/natural-gallery.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/assets/natural-gallery-js/natural-gallery.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/assets/natural-gallery-js/natural-gallery.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)