Skip to content
This repository was archived by the owner on Feb 18, 2024. It is now read-only.

Clean up linting configuration #268

Merged
merged 1 commit into from
Jul 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .eslintignore

This file was deleted.

50 changes: 5 additions & 45 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,57 +1,17 @@
/* eslint-disable import/no-extraneous-dependencies */
const {
rules: airbnbBaseStyle,
} = require('eslint-config-airbnb-base/rules/style');
const {
rules: airbnbBaseBestPractices,
} = require('eslint-config-airbnb-base/rules/best-practices');

module.exports = {
root: true,
extends: [
'eslint-config-airbnb-base',
'plugin:prettier/recommended',
'prettier/babel',
'eslint-config-prettier',
'plugin:jest/recommended',
'plugin:jest/style',
],
plugins: ['eslint-plugin-babel'],
parser: 'babel-eslint',
env: {
es6: true,
commonjs: true,
node: true,
},
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
},
// Force dotfiles to be checked, since by default ESLint ignores them.
ignorePatterns: ['!.*.js'],
reportUnusedDisableDirectives: true,
rules: {
// Disable rules for which there are eslint-plugin-babel replacements:
// https://github.com/babel/eslint-plugin-babel#rules
'new-cap': 'off',
'no-invalid-this': 'off',
'object-curly-spacing': 'off',
semi: 'off',
'no-unused-expressions': 'off',
// Ensure the replacement rules use the options set by airbnb rather than ESLint defaults.
'babel/new-cap': airbnbBaseStyle['new-cap'],
'babel/no-invalid-this': airbnbBaseBestPractices['no-invalid-this'],
'babel/object-curly-spacing': airbnbBaseStyle['object-curly-spacing'],
'babel/semi': airbnbBaseStyle.semi,
'babel/no-unused-expressions':
airbnbBaseBestPractices['no-unused-expressions'],
'class-methods-use-this': 'off',
'no-shadow': 'off',
'no-underscore-dangle': 'off',
'prettier/prettier': [
'error',
{
singleQuote: true,
jsxBracketSameLine: true,
trailingComma: 'all',
proseWrap: 'always',
endOfLine: 'lf',
},
],
},
};
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Since autogenerated file
CHANGELOG.md

# Since it formats the inline code blocks, worsening readability
README.md
4 changes: 4 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
singleQuote: true,
trailingComma: 'all',
};
29 changes: 15 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,22 @@ dist: bionic
language: node_js
cache: yarn
node_js:
- '10'
- '12'
- '14'
- '10'
- '12'
- '14'
jobs:
include:
# Prettier has dropped support for Node 8, so we have to skip linting and use --ignore-engines.
- node_js: 8
install:
- yarn --frozen-lockfile --ignore-engines
script:
- yarn test
- yarn test:types
# Prettier has dropped support for Node 8, so we have to skip linting and use --ignore-engines.
- node_js: 8
install:
- yarn --frozen-lockfile --ignore-engines
script:
- yarn test
- yarn test:types
install:
- yarn --frozen-lockfile
- yarn --frozen-lockfile
script:
- yarn lint
- yarn test
- yarn test:types
- yarn lint
- yarn style
- yarn test
- yarn test:types
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,13 @@
"author": "Eli Perelman <eli@eliperelman.com>",
"license": "MPL-2.0",
"scripts": {
"fix": "yarn lint:fix && yarn style:fix",
"lint": "eslint --cache --max-warnings 0 --format codeframe .",
"lint:fix": "yarn lint --fix",
"style": "prettier --check .",
"style:fix": "prettier --write .",
"test": "jest",
"test:types": "tsc -p ./types/test/tsconfig.json",
"lint": "eslint --cache --report-unused-disable-directives --format codeframe \".*.js\" \"*.js\" src test",
"changelog": "auto-changelog --remote upstream --commit-limit false",
"version": "yarn changelog --package && git add CHANGELOG.md"
},
Expand All @@ -37,14 +41,11 @@
"@types/tapable": "^1.0.6",
"@types/webpack": "^4.41.21",
"auto-changelog": "^2.2.0",
"babel-eslint": "^10.1.0",
"eslint": "^7.5.0",
"eslint-config-airbnb-base": "^14.2.0",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-babel": "^5.3.1",
"eslint-plugin-import": "^2.22.0",
"eslint-plugin-jest": "^23.18.0",
"eslint-plugin-prettier": "^3.1.4",
"jest": "^25.3.0",
"prettier": "^2.0.5",
"typescript": "^3.9.7",
Expand Down
4 changes: 1 addition & 3 deletions renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
":semanticCommitsDisabled",
":unpublishSafe"
],
"reviewers": [
"neutrinojs/core-contributors"
],
"reviewers": ["neutrinojs/core-contributors"],
"pinVersions": false
}
Loading