forked from GoogleChrome/chrome-extensions-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add prettier and eslint (GoogleChrome#831)
* Ignores archived samples * Uses eslint/recommended rules * Runs prettier and eslint (including --fix) pre-commit via husky * Adds new npm scripts: 'lint', 'lint:fix' and 'prettier' * Does not lint inline js code * Fix all prettier and eslint errors * Add custom prettier rules * Apply custom prettier rules * Update readme to explain how to setup the repo * addressed comments
- Loading branch information
1 parent
299f213
commit dc21743
Showing
83 changed files
with
4,827 additions
and
1,103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
_archive | ||
third-party | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* eslint-env node */ | ||
module.exports = { | ||
extends: ['prettier', 'eslint:recommended'], | ||
plugins: ['prettier'], | ||
rules: { | ||
'prettier/prettier': ['error'], | ||
'no-unused-vars': [ | ||
'warn', | ||
{ | ||
argsIgnorePattern: '^_', | ||
varsIgnorePattern: '^_' | ||
} | ||
] | ||
}, | ||
env: { | ||
browser: true, | ||
webextensions: true, | ||
es2021: true, | ||
jquery: true, | ||
worker: true | ||
}, | ||
overrides: [], | ||
parserOptions: { | ||
ecmaVersion: 'latest', | ||
sourceType: 'module' | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
*~ | ||
*.DS_store | ||
|
||
node_modules | ||
# Temporary directory for debugging extension samples | ||
_debug |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
npx lint-staged |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
_archive | ||
third-party | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"printWidth": 80, | ||
"tabWidth": 2, | ||
"semi": true, | ||
"singleQuote": true, | ||
"trailingComma": "none", | ||
"bracketSpacing": true, | ||
"arrowParens": "always" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,48 @@ | ||
# Contributing to this Repository | ||
# How to Contribute | ||
|
||
Thank you for your interest in contributing! | ||
We'd love to accept your patches and contributions to this project. | ||
|
||
Send us your patches early and often and in whatever shape or form. | ||
## Before you begin | ||
|
||
## Legal | ||
### Sign our Contributor License Agreement | ||
|
||
Unfortunately there are some legal hurdles. Sorry about that. | ||
Contributions to this project must be accompanied by a | ||
[Contributor License Agreement](https://cla.developers.google.com/about) (CLA). | ||
You (or your employer) retain the copyright to your contribution; this simply | ||
gives us permission to use and redistribute your contributions as part of the | ||
project. | ||
|
||
This repository is a Google open source project, and so we require contributors to sign Google's open source Contributor License Agreement. | ||
It's easy to do, just click here to sign as an [individual](https://developers.google.com/open-source/cla/individual) or [corporation](https://developers.google.com/open-source/cla/corporate). | ||
Individuals can sign electronically in seconds (see the bottom of the page); corporations will need to email a PDF, or mail. | ||
If you or your current employer have already signed the Google CLA (even if it | ||
was for a different project), you probably don't need to do it again. | ||
|
||
We cannot accept PRs or patches larger than fixing typos and the like without a signed CLA. | ||
Visit <https://cla.developers.google.com/> to see your current agreements or to | ||
sign a new one. | ||
|
||
If your Github account doesn't show the name you used to sign, please mention your name in your PR. | ||
### Review our Community Guidelines | ||
|
||
This project follows [Google's Open Source Community | ||
Guidelines](https://opensource.google/conduct/). | ||
|
||
## Contribution process | ||
|
||
### Code Reviews | ||
|
||
All submissions, including submissions by project members, require review. We | ||
use GitHub pull requests for this purpose. Consult | ||
[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more | ||
information on using pull requests. | ||
|
||
### Setting up your Environment | ||
|
||
If you want to contribute to this repository, you need to first [create your own fork](https://docs.github.com/en/get-started/quickstart/fork-a-repo). | ||
After forking chrome-extensions-samples to your own Github account, run the following steps to get started: | ||
|
||
```sh | ||
# clone your fork to your local machine | ||
git clone https://github.com/your-fork/chrome-extensions-samples.git | ||
|
||
cd chrome-extensions-samples | ||
|
||
# install dependencies | ||
npm install | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.