Skip to content

Commit

Permalink
feat: Add initial setup for new package tested locally
Browse files Browse the repository at this point in the history
  • Loading branch information
JackHowa committed Feb 23, 2022
0 parents commit 50e88ba
Show file tree
Hide file tree
Showing 6 changed files with 2,483 additions and 0 deletions.
88 changes: 88 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
module.exports = {
env: {
browser: true,
es6: true,
jest: true,
},
extends: ["airbnb", "prettier"],
globals: {
Atomics: "readonly",
SharedArrayBuffer: "readonly",
Fusion: "readonly",
},
parser: "@babel/eslint-parser",
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 2020,
sourceType: "module",
},
plugins: ["react", "jest", "jsx-a11y", "react-hooks", "sort-exports"],
rules: {
"global-require": "off",
indent: ["error", "tab"],
"no-tabs": ["error", { allowIndentationTabs: true }],
"react/jsx-indent": [2, "tab"],
"react/jsx-indent-props": [2, "tab"],
"no-underscore-dangle": ["error", { allow: ["_website", "_id"] }],
"import/no-extraneous-dependencies": "off", // This might be fine. It's worth looking into at the very least.
"react/forbid-prop-types": "off",
"react/function-component-definition": [
2,
{ namedComponents: "arrow-function" },
],
"react/prop-types": "off", // We will want to be more granular with this I assume.
"react/react-in-jsx-scope": "off",
"react/require-default-props": "off", // We will also want to have some rules around this. Whitelisting certain props for example
"react/no-danger": "off",
"react/jsx-props-no-spreading": "off",
// For list of a11y definitions for this see: https://github.com/evcohen/eslint-plugin-jsx-a11y
"jsx-a11y/accessible-emoji": 2,
"jsx-a11y/alt-text": 2,
"jsx-a11y/anchor-has-content": 2,
"jsx-a11y/anchor-is-valid": 2,
"jsx-a11y/aria-activedescendant-has-tabindex": 2,
"jsx-a11y/aria-props": 2,
"jsx-a11y/aria-proptypes": 2,
"jsx-a11y/aria-role": 2,
"jsx-a11y/aria-unsupported-elements": 2,
"jsx-a11y/click-events-have-key-events": 2,
"jsx-a11y/heading-has-content": 2,
"jsx-a11y/html-has-lang": 2,
"jsx-a11y/iframe-has-title": 2,
"jsx-a11y/img-redundant-alt": "off",
"jsx-a11y/interactive-supports-focus": 2,
"jsx-a11y/label-has-associated-control": [
2,
{
required: {
some: ["nesting", "id"],
},
},
],
"jsx-a11y/lang": 2,
"jsx-a11y/media-has-caption": "off",
"jsx-a11y/mouse-events-have-key-events": 2,
"jsx-a11y/no-access-key": 2,
"jsx-a11y/no-autofocus": 2,
"jsx-a11y/no-distracting-elements": 2,
"jsx-a11y/no-interactive-element-to-noninteractive-role": 2,
"jsx-a11y/no-noninteractive-element-interactions": "off",
"jsx-a11y/no-noninteractive-element-to-interactive-role": "off",
"jsx-a11y/no-noninteractive-tabindex": 2,
"jsx-a11y/no-onchange": 2,
"jsx-a11y/no-redundant-roles": 2,
"jsx-a11y/no-static-element-interactions": 2,
"jsx-a11y/role-has-required-aria-props": 2,
"jsx-a11y/role-supports-aria-props": 2,
"jsx-a11y/scope": 2,
"jsx-a11y/tabindex-no-positive": 2,
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "error",
"sort-exports/sort-exports": [
"error",
{ sortDir: "asc", ignoreCase: true, sortExportKindFirst: "type" },
],
},
};
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# @wpmedia/eslint-config-themes

## Usage

`npm i --save-dev @wpmedia/eslint-config-themes`

Your .eslintrc.js file should look like:

```
module.exports = {
extends: ["@wpmedia/eslint-config-themes"]
};
```
3 changes: 3 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const eslintrc = require('./.eslintrc.js');

module.exports = eslintrc;
Loading

0 comments on commit 50e88ba

Please sign in to comment.