Skip to content
This repository has been archived by the owner on Aug 1, 2024. It is now read-only.

Commit

Permalink
Merge pull request #2 from swrlab/dev/prettier-0-2-0
Browse files Browse the repository at this point in the history
fix: update prettier config
  • Loading branch information
frytg authored Aug 9, 2022
2 parents e403814 + a2c6907 commit f2f56a2
Show file tree
Hide file tree
Showing 16 changed files with 1,943 additions and 88 deletions.
28 changes: 26 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# editorconfig.org
# docs: https://editorconfig.org
# please make sure to keep this file in sync between repositories
# to main file should be edited in `swr-prettier-config` and copied where needed

root = true

Expand All @@ -7,12 +9,34 @@ charset = utf-8
end_of_line = lf
indent_style = tab
indent_size = 8
print_width = 120
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
indent_style = space
indent_size = 2

[*.{yml,yaml}]
indent_style = space
indent_size = 2

# LiquidSoap config files
[*.liq]
indent_style = space
indent_size = 2

# Terraform config files
[*.tf]
indent_style = space
indent_size = 2

[*.yml]
# Linting toml config files
[*.toml]
indent_style = space
indent_size = 2

# Auto-generated CSV Files
[*.csv]
insert_final_newline = false
8 changes: 8 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"parserOptions": {
"ecmaVersion": 2020
},
"root": true,
"plugins": ["@swrlab/eslint-plugin-swr"],
"extends": ["plugin:@swrlab/eslint-plugin-swr/recommended"]
}
14 changes: 14 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: 2
updates:
- package-ecosystem: 'npm'
directory: '/'
open-pull-requests-limit: 10
schedule:
interval: 'weekly'
day: 'sunday'
- package-ecosystem: 'github-actions'
directory: '/'
open-pull-requests-limit: 10
schedule:
interval: 'weekly'
day: 'sunday'
7 changes: 7 additions & 0 deletions .github/linters/.yamllint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
extends: default

rules:
document-start: disable
line-length:
max: 120
45 changes: 36 additions & 9 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,46 @@
---
name: Lint code
name: Linter

on: [push]
on:
pull_request:

env:
DEFAULT_BRANCH: main
EDITORCONFIG_FILE_NAME: /.editorconfig
IGNORE_GITIGNORED_FILES: true
JAVASCRIPT_DEFAULT_STYLE: prettier
JAVASCRIPT_ES_CONFIG_FILE: /.eslintrc.json
LINTER_RULES_PATH: /
LOG_LEVEL: VERBOSE
MARKDOWN_CONFIG_FILE: /.markdownlint.yaml
NODE_VERSION: 18
VALIDATE_ALL_CODEBASE: true
YAML_CONFIG_FILE: /.github/linters/.yamllint.yaml

jobs:
build:
name: Lint Code Base
runs-on: ubuntu-latest

timeout-minutes: 70
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: 👀 Checkout repo
uses: actions/checkout@v3

- name: ⛺️ Install Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'yarn'
cache-dependency-path: '**/yarn.lock'

- name: 📦 Install Dependencies
run: yarn

- name: Lint Code Base
uses: docker://github/super-linter:v2.2.0
- name: 📚 Lint Code Base
uses: docker://github/super-linter:v4
with:
context: .
cache-from: type=gha
cache-to: type=gha,mode=max
env:
VALIDATE_ALL_CODEBASE: true
VALIDATE_ANSIBLE: false
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27 changes: 0 additions & 27 deletions .github/workflows/publish.yml

This file was deleted.

3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules/
node_modules/
.DS_Store
34 changes: 34 additions & 0 deletions .markdownlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# see config https://github.com/DavidAnson/markdownlint#optionsconfig
# see example file https://github.com/DavidAnson/markdownlint/blob/main/schema/.markdownlint.yaml
# see rules https://github.com/markdownlint/markdownlint/blob/master/docs/RULES.md

# Default state for all rules
default: true

# Unordered list style
MD004: true

MD007:
# Unordered list indentation
indent: 2

# MD013/line-length - Line length
MD013:
# Number of characters
line_length: 808

MD026:
# List of not allowed
punctuation: '.,;:!。,;:'

# Ordered list item prefix
MD029: false

# Allow inline HTML
MD033: false

# Emphasis used instead of a heading
MD036: false

# Error on blank lines
blank_lines: false
4 changes: 2 additions & 2 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
...require("./index"),
};
...require('./index'),
}
7 changes: 7 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Copyright 2020 SWR Audio Lab

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
37 changes: 37 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# SWR Prettier config

- [SWR Prettier config](#swr-prettier-config)
- [Installation](#installation)
- [Editor Config](#editor-config)

## Installation

Step 1: Install [npm package](https://www.npmjs.com/package/@swrlab/swr-prettier-config)

```shell
npm install @swrlab/swr-prettier-config --save-dev
```

or

```shell
yarn add @swrlab/swr-prettier-config -D
```

Step 2: Include in `package.json`:

```json
{
"prettier": "@swrlab/swr-prettier-config"
}
```

Or create a `.prettierrc.json` file with a link:

```json
"@swrlab/swr-prettier-config"
```

## Editor Config

This repository also contains a [`.editorconfig`](./.editorconfig) file. Consider this version as the main and copy it to other repositories where needed. This should ensure that the same copy is used everywhere.
18 changes: 17 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,21 @@ module.exports = {
trailingComma: 'es5', // default since 2.0.0
bracketSpacing: true, // default
arrowParens: 'always', // default since 2.0.0
endOfLine: 'lf', // default since 2.0.0
endOfLine: 'lf', // default since 2.0.0,
overrides: [
{
files: ['*.md'],
options: {
useTabs: false,
tabWidth: 2,
},
},
{
files: ['*.yml', '*.yaml'],
options: {
useTabs: false,
tabWidth: 2,
},
},
],
}
18 changes: 0 additions & 18 deletions license.md

This file was deleted.

14 changes: 9 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
{
"name": "@swrlab/swr-prettier-config",
"version": "0.1.2",
"description": "SWR Prettier config.",
"version": "0.2.0",
"description": "SWR Audio Lab Prettier config",
"license": "MIT",
"main": "index.js",
"keywords": [
"prettier",
"swrlab"
],
"files": [
"index.js"
],
"license": "ISC",
"author": "SWR Audio Lab <[email protected]>",
"main": "index.js",
"repository": {
"type": "git",
"url": "https://github.com/swrlab/swr-prettier-config"
},
"bugs": "https://github.com/swrlab/swr-prettier-config/issues",
"homepage": "https://github.com/swrlab/swr-prettier-config#readme",
"devDependencies": {
"@swrlab/eslint-plugin-swr": "0.2.0",
"eslint": "^8.21.0"
},
"scripts": {}
}
}
23 changes: 0 additions & 23 deletions readme.md

This file was deleted.

Loading

0 comments on commit f2f56a2

Please sign in to comment.