Skip to content

Commit 80e5bcd

Browse files
first commit
0 parents  commit 80e5bcd

13 files changed

+7526
-0
lines changed

.gitignore

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# --- Windows and Mac files
2+
[Tt]humbs.db
3+
.DS_Store
4+
5+
# --- Root
6+
/*
7+
!.github
8+
!.gitignore
9+
!configs
10+
!rules
11+
!index.js
12+
!README.md
13+
!LICENSE
14+
!package.json
15+
!package-lock.json
16+
17+
# -- Rules
18+
!Travelopia-WordPress

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 Travelopia
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Travelopia WordPress JavaScript Coding Standards
2+
3+
![maintenance-status](https://img.shields.io/badge/maintenance-actively--developed-brightgreen.svg)
4+
5+
Official Travelopia WordPress JavaScript coding standards.
6+
7+
<table width="100%">
8+
<tr>
9+
<td align="left" width="70%">
10+
<p>Built by the super talented team at <strong><a href="https://www.travelopia.com/work-with-us/">Travelopia</a></strong>.</p>
11+
</td>
12+
<td align="center" width="30%">
13+
<img src="https://www.travelopia.com/wp-content/themes/travelopia/assets/svg/logo-travelopia-circle.svg" width="50" />
14+
</td>
15+
</tr>
16+
</table>
17+
18+
## Installation
19+
Install the library via NPM:
20+
21+
```
22+
$ npm install @travelopia/eslint-plugin-wordpress-coding-standards --save-dev
23+
```

configs/default.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
module.exports = {
2+
plugins: [ '@travelopia/wordpress-coding-standards' ],
3+
extends: 'plugin:@wordpress/eslint-plugin/recommended-with-formatting',
4+
overrides: [
5+
{
6+
'files': [ '*.ts', '*.tsx' ],
7+
'rules': {
8+
'no-undef': 'off',
9+
'no-unused-vars': 'off',
10+
'import/named': 'off',
11+
'import/no-unresolved': 'off',
12+
'import/no-extraneous-dependencies': 'off'
13+
}
14+
}
15+
],
16+
rules: {
17+
'react-hooks/rules-of-hooks': 'off',
18+
'react-hooks/exhaustive-deps': 'off',
19+
'@travelopia/wordpress-coding-standards/comment-before-code-block': 'error',
20+
'@travelopia/wordpress-coding-standards/first-line-function-comment': 'error',
21+
'@travelopia/wordpress-coding-standards/comment-before-return': 'error',
22+
'@travelopia/wordpress-coding-standards/empty-line-before-comment': 'error',
23+
'@travelopia/wordpress-coding-standards/empty-line-before-control': 'error',
24+
'@travelopia/wordpress-coding-standards/file-first-line-doc-comment': 'error',
25+
}
26+
};

index.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
module.exports = {
2+
configs: {
3+
'default': require( './configs/default' ),
4+
},
5+
rules: {
6+
'comment-before-code-block': require( './rules/comment-before-code-block' ),
7+
'first-line-function-comment': require( './rules/first-line-function-comment' ),
8+
'comment-before-return': require( './rules/comment-before-return' ),
9+
'empty-line-before-comment': require( './rules/empty-line-before-comment' ),
10+
'empty-line-before-control': require( './rules/empty-line-before-control' ),
11+
'file-first-line-doc-comment': require( './rules/file-first-line-doc-comment' ),
12+
},
13+
};

0 commit comments

Comments
 (0)