Skip to content

Commit

Permalink
feat: typescript config (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiTenno authored Sep 26, 2022
1 parent f41705e commit c101669
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 70 deletions.
1 change: 0 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
'use strict';

module.exports = {
globals: {},
rules: {
'valid-jsdoc': [
'error',
Expand Down
59 changes: 1 addition & 58 deletions esm.js
Original file line number Diff line number Diff line change
@@ -1,67 +1,10 @@
'use strict';

module.exports = {
globals: {},
rules: {
'valid-jsdoc': [
'error',
{
requireReturn: false,
requireReturnDescription: false,
preferType: {
String: 'string',
Number: 'number',
Boolean: 'boolean',
Function: 'function',
object: 'Object',
date: 'Date',
error: 'Error',
},
prefer: {
return: 'returns',
},
},
],
strict: ['error', 'safe'],
'linebreak-style': ['error', 'unix'],
'no-await-in-loop': 'off',
'arrow-parens': ['error', 'always'],
'func-names': 0,
'global-require': 0,
'no-param-reassign': 'off',
'no-continue': 'off',
'lines-between-class-members': 'off',
'no-fallthrough': 'off',
'no-case-declarations': 'off',
'default-case': 'off',
'max-classes-per-file': 'off',
'consistent-return': 'off',
'class-methods-use-this': 'off',
'max-len': [
'error',
{
code: 120,
tabWidth: 2,
comments: 120,
ignoreTemplateLiterals: true,
ignoreStrings: true,
ignoreRegExpLiterals: true,
},
],
'import/no-unresolved': 0,
'import/no-extraneous-dependencies': ['error', { devDependencies: ['**/*.test.js', '**/*.spec.js'] }],
'no-null/no-null': 2,
'import/extensions': 0,
'prettier/prettier': [
'error',
{},
{
usePrettierrc: true,
},
],
},
extends: ['airbnb-base', 'plugin:prettier/recommended'],
plugins: ['no-null'],
extends: ['@wfcd'],
parser: '@babel/eslint-parser',
parserOptions: {
sourceType: 'module',
Expand Down
26 changes: 15 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,25 @@
"exports": {
".": "./index.js",
"./esm": "./esm.js",
"./prettier": "./prettier.config.js"
"./prettier": "./prettier.config.js",
"./typescript": "./typescript.js"
},
"peerDependencies": {
"@babel/core": "^7.17.8",
"@babel/eslint-parser": "^7.17.0",
"@babel/plugin-proposal-class-properties": "^7.16.7",
"@babel/plugin-proposal-private-methods": "^7.16.11",
"@babel/preset-env": "^7.16.11",
"eslint": "^7.5.0",
"eslint-config-airbnb-base": "^14.2.1",
"@babel/core": "^7.19.1",
"@babel/eslint-parser": "^7.19.1",
"@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/plugin-proposal-private-methods": "^7.18.6",
"@babel/preset-env": "^7.19.1",
"@typescript-eslint/eslint-plugin": "^5.38.0",
"@typescript-eslint/parser": "^5.38.0",
"eslint": "^8.24.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-import": "^2.25.3",
"eslint-config-airbnb-typescript": "17.0.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-no-null": "^1.0.2",
"eslint-plugin-prettier": "^4.0.0",
"prettier": "^2.6.1"
"eslint-plugin-prettier": "^4.2.1",
"prettier": "^2.7.1"
},
"engines": {
"npm": ">=7"
Expand Down
23 changes: 23 additions & 0 deletions typescript.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
'use strict';

module.exports = {
extends: [
'@wfcd/eslint-config/esm',
'airbnb-typescript/base',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
],
rules: {
'impot/no-unresolved': 'off',
},
parserOptions: {
sourceType: 'module',
ecmaVersion: 6,
ecmaFeatures: {
modules: true,
},
babelOptions: {
plugins: ['@babel/plugin-proposal-class-properties', '@babel/plugin-proposal-private-methods'],
},
},
};

0 comments on commit c101669

Please sign in to comment.