Skip to content

Commit

Permalink
update ESLint to v8, config improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
elliottregan committed Oct 14, 2021
1 parent ef4a749 commit 269cbc6
Show file tree
Hide file tree
Showing 12 changed files with 353 additions and 417 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist
20 changes: 5 additions & 15 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,35 +1,25 @@
module.exports = {
root: true,
env: {
es2021: true,
node: true,
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'airbnb-base',
'airbnb-typescript/base',
'plugin:@typescript-eslint/recommended',
],
globals: {
translationJSON: true,
},
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 12,
sourceType: 'module',
project: './tsconfig.json',
},
plugins: [
'@typescript-eslint',
],
rules: {
'import/extensions': [
'error',
'ignorePackages',
{
js: 'never',
mjs: 'never',
jsx: 'never',
ts: 'never',
tsx: 'never',
},
],
'no-console': 'off',
},
};
4 changes: 2 additions & 2 deletions index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { sum } from './src';
import sum from './src';

console.log(sum(1, 1));
console.log(sum(1, 1));
24 changes: 12 additions & 12 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
export default {
"roots": [
"<rootDir>/src",
"<rootDir>/spec",
],
"testMatch": [
"**/__tests__/**/*.+(ts|tsx|js)",
"**/?(*.)+(spec|test).+(ts|tsx|js)"
],
"transform": {
"^.+\\.(ts|tsx)$": "ts-jest"
},
}
rootDir: './',
roots: [
'<rootDir>/src',
'<rootDir>/spec',
],
testMatch: [
'**/?(*.)+(spec).+(ts|tsx|js)',
],
transform: {
'^.+\\.(ts|tsx)$': 'ts-jest',
},
};
5 changes: 4 additions & 1 deletion makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,7 @@ test:
make run c="npm run test"

update:
make run c="npm update"
make run c="npm update"

lint:
make run c="npm run lint"
Loading

0 comments on commit 269cbc6

Please sign in to comment.