generated from Exabyte-io/template-definitions
-
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.
Merge pull request #1 from Exabyte-io/feat/SOF-6397
SOF-6397: Create mat3ra eslint config and publish on npm
- Loading branch information
Showing
8 changed files
with
5,516 additions
and
162 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
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,12 +1,40 @@ | ||
# template-definitions | ||
[![npm version](https://badge.fury.io/js/%40exabyte-io%2Feslint-config-mat3ra.svg)](https://badge.fury.io/js/%40exabyte-io%2Feslint-config-mat3ra) | ||
[![License: Apache](https://img.shields.io/badge/License-Apache-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0) | ||
|
||
Template repository for entity definition libraries in Javascript | ||
# eslint-config-mat3ra | ||
|
||
See [here](https://docs.github.com/en/github-ae@latest/repositories/creating-and-managing-repositories/creating-a-repository-from-a-template) | ||
for details on how to use this repository. | ||
## How to use | ||
|
||
Included is a simple `template.py` analog to `cookiecutter` which will prompt | ||
the user for some information and then write out templated values in select files. | ||
After usage, the `template.py` file can be removed and the `README.md` and associated | ||
`files` can be committed. | ||
1. Install config with eslint and eslint plugins | ||
|
||
``` | ||
npm install --save-dev \ | ||
@exabyte-io/[email protected] \ | ||
@babel/[email protected] \ | ||
@babel/[email protected] \ | ||
@babel/[email protected] \ | ||
@babel/[email protected] \ | ||
@babel/register@^7.16.0 \ | ||
@babel/[email protected] \ | ||
[email protected] \ | ||
[email protected] \ | ||
[email protected] \ | ||
eslint-import-resolver-exports@^1.0.0-beta.2 \ | ||
eslint-import-resolver-meteor@^0.4.0 \ | ||
eslint-import-resolver-node@^0.3.6 \ | ||
[email protected] \ | ||
[email protected] \ | ||
[email protected] \ | ||
[email protected] \ | ||
[email protected] \ | ||
[email protected] | ||
``` | ||
|
||
|
||
2. Create own `.eslintrc.json`: | ||
|
||
``` | ||
{ | ||
"extends": "mat3ra" | ||
} | ||
``` |
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,78 @@ | ||
module.exports = { | ||
extends: ['airbnb', 'eslint:recommended'], | ||
settings: { | ||
'import/resolver': { | ||
node: { | ||
paths: ['src'], | ||
}, | ||
exports: {}, | ||
}, | ||
}, | ||
parser: '@babel/eslint-parser', | ||
env: { | ||
browser: true, | ||
node: true, | ||
mocha: true, | ||
}, | ||
plugins: ['simple-import-sort', 'jsdoc'], | ||
rules: { | ||
'array-element-newline': ['error', 'consistent'], | ||
'no-plusplus': ['error', { allowForLoopAfterthoughts: true }], | ||
'one-var': ['error', { uninitialized: 'always', initialized: 'never' }], | ||
'brace-style': ['error', '1tbs', { allowSingleLine: true }], | ||
'prefer-template': 'off', | ||
camelcase: 'off', | ||
'no-console': 'off', | ||
'no-unused-expressions': 'warn', | ||
'no-confusing-arrow': 'off', | ||
'no-underscore-dangle': 'off', | ||
'no-return-assign': 'off', | ||
'consistent-return': 'off', | ||
'arrow-body-style': 'off', | ||
'import/prefer-default-export': 'off', | ||
'import/no-named-as-default-member': 'warn', | ||
'no-param-reassign': ['warn', { props: false }], | ||
'max-classes-per-file': 'warn', | ||
'simple-import-sort/imports': [ | ||
'warn', | ||
{ | ||
groups: [ | ||
// Side effect imports. | ||
['^\\u0000'], | ||
// Packages. | ||
// Things that start with a letter (or digit or underscore), or `@` followed by a letter. | ||
['^@?\\w'], | ||
// Absolute imports | ||
[ | ||
'^(components|configs|constants|containers|domain|enhancers|hocs|libs|pages|reducers|services|store|modules|dictionaries)(/.*|$)', | ||
], | ||
// Relative imports. | ||
// Anything that starts with a dot. | ||
['^\\.'], | ||
], | ||
}, | ||
], | ||
indent: [ | ||
'error', | ||
4, | ||
{ | ||
SwitchCase: 1, | ||
ignoredNodes: ['TemplateLiteral'], | ||
}, | ||
], | ||
'comma-dangle': ['error', 'always-multiline'], | ||
quotes: [1, 'double', 'avoid-escape'], | ||
'jsx-quotes': ['error', 'prefer-double'], | ||
'max-len': [ | ||
'error', | ||
100, | ||
4, | ||
{ | ||
ignoreUrls: true, | ||
ignoreComments: true, | ||
ignoreTemplateLiterals: true, | ||
ignoreStrings: true, | ||
}, | ||
], | ||
}, | ||
}; |
Oops, something went wrong.