Skip to content

Commit

Permalink
chore: Run prettier formatting outside ESLint
Browse files Browse the repository at this point in the history
Run on all the repo files except the HTML and handlebars files.
Include it in the commit hooks and CI
  • Loading branch information
nschonni committed Dec 7, 2021
1 parent 0217a5d commit a783ae0
Show file tree
Hide file tree
Showing 23 changed files with 1,075 additions and 986 deletions.
13 changes: 2 additions & 11 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,7 @@
"widl",
"YYYYMMDD"
],
"dictionaries": [
"html",
"js",
"css",
"npm",
"en-gb"
],
"dictionaries": ["html", "js", "css", "npm", "en-gb"],
"ignorePaths": [
"**/*.eot",
"**/*.ttf",
Expand All @@ -168,8 +162,5 @@
"node_modules/**"
],
"allowCompoundWords": true,
"ignoreWords": [
"en",
"gb"
]
"ignoreWords": ["en", "gb"]
}
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[package.json]
[{package*.json,*.yml}]
indent_size = 2
99 changes: 43 additions & 56 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,59 +1,46 @@
{
"extends": [
"airbnb-base", "prettier"
],
"plugins": ["prettier"],
"rules": {
"prettier/prettier": "error",
"no-shadow": "off",
"func-names": "off",
"vars-on-top": "off",
"consistent-return":"warn",
"no-param-reassign":"off",
"no-plusplus":"off",
"strict": "off",
"global-require":"off",
"no-restricted-syntax":"warn",
"guard-for-in":"warn",
"no-underscore-dangle":"warn",
"prefer-destructuring": "warn"
},
"overrides": [
{
"files": [
"public/js/*.js"
],
"env": {
"browser": true,
"jquery": true,
"es6": true
},
"rules": {
}
"extends": ["airbnb-base", "prettier"],
"plugins": ["prettier"],
"rules": {
"prettier/prettier": "error",
"no-shadow": "off",
"func-names": "off",
"vars-on-top": "off",
"consistent-return": "warn",
"no-param-reassign": "off",
"no-plusplus": "off",
"strict": "off",
"global-require": "off",
"no-restricted-syntax": "warn",
"guard-for-in": "warn",
"no-underscore-dangle": "warn",
"prefer-destructuring": "warn"
},
{
"files": [
"app.js",
"lib/**/*.js",
"tools/**/*.js"
],
"plugins": ["node"],
"extends": [
"plugin:node/recommended"
]
},
{
"files": [
"test/**/*.js"
],
"env": {
"mocha": true
},
"rules": {
"node/no-unpublished-require": "off"
},
"plugins": ["node"],
"extends": "plugin:node/recommended"
}
]
"overrides": [
{
"files": ["public/js/*.js"],
"env": {
"browser": true,
"jquery": true,
"es6": true
},
"rules": {}
},
{
"files": ["app.js", "lib/**/*.js", "tools/**/*.js"],
"plugins": ["node"],
"extends": ["plugin:node/recommended"]
},
{
"files": ["test/**/*.js"],
"env": {
"mocha": true
},
"rules": {
"node/no-unpublished-require": "off"
},
"plugins": ["node"],
"extends": "plugin:node/recommended"
}
]
}
30 changes: 15 additions & 15 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
version: 2
updates:
- package-ecosystem: npm
directory: "/"
schedule:
interval: weekly
time: "00:00"
open-pull-requests-limit: 10
ignore:
- dependency-name: "*"
update-types: ["version-update:semver-patch"]
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: weekly
time: "00:00"
open-pull-requests-limit: 10
- package-ecosystem: npm
directory: '/'
schedule:
interval: weekly
time: '00:00'
open-pull-requests-limit: 10
ignore:
- dependency-name: '*'
update-types: ['version-update:semver-patch']
- package-ecosystem: github-actions
directory: '/'
schedule:
interval: weekly
time: '00:00'
open-pull-requests-limit: 10
24 changes: 12 additions & 12 deletions .github/workflows/cspell-problem-matcher.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"problemMatcher": [
{
"owner": "cspell",
"pattern": [
"problemMatcher": [
{
"regexp": "^(.*):(\\d+):(\\d+)\\s+\\-\\s+(.*)$",
"file": 1,
"line": 2,
"column": 3,
"message": 4
"owner": "cspell",
"pattern": [
{
"regexp": "^(.*):(\\d+):(\\d+)\\s+\\-\\s+(.*)$",
"file": 1,
"line": 2,
"column": 3,
"message": 4
}
]
}
]
}
]
]
}
30 changes: 15 additions & 15 deletions .github/workflows/js-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ name: Lint JS
on:
push:
paths:
- "**/*.js"
- "jsdoc.json"
- "package.json"
- '**/*.js'
- 'jsdoc.json'
- 'package.json'
pull_request:
paths:
- "**/*.js"
- "jsdoc.json"
- "package.json"
- '**/*.js'
- 'jsdoc.json'
- 'package.json'

jobs:
lint:
Expand All @@ -19,16 +19,16 @@ jobs:
matrix:
node-version: [14.x, 16.x]
steps:
- uses: actions/[email protected]
- uses: actions/[email protected]

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: npm
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: npm

- run: npm ci
- run: npm ci

- run: npm run lint
- run: npm run lint

- run: npm run jsdoc
- run: npm run jsdoc
4 changes: 2 additions & 2 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ jobs:
uses: rectalogic/notify-irc@v1
if: failure() && github.event.pull_request.draft == false
with:
server: "irc.w3.org"
server: 'irc.w3.org'
port: 6679
channel: "#pubrules"
channel: '#pubrules'
nickname: gh-action-notifier
tls: true
message: |
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,4 @@ doc/api/
.vscode/

.nyc_output
.eslintcache
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.html
*.handlebars
lib/rules/structure/display-only.js
Loading

0 comments on commit a783ae0

Please sign in to comment.