Skip to content

Commit

Permalink
Merge pull request #11 from ijsto/SA/ESLint-8
Browse files Browse the repository at this point in the history
Add support to ESLint V8
  • Loading branch information
ScottAgirs committed Nov 10, 2021
2 parents d5cb0af + 42b052e commit dc3e4a6
Show file tree
Hide file tree
Showing 5 changed files with 315 additions and 359 deletions.
11 changes: 9 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const base = require('./src/base');
const jsxA11y = require('./src/jsx-a11y');
const next = require('./src/next');
const node = require('./src/node');
const strapi = require('./src/strapi');
const prettier = require('./src/prettier');
const react = require('./src/react');
const reactHooks = require('./src/react-hooks');
Expand All @@ -27,6 +28,8 @@ const usesBabelConfig = findUp.sync([
]);
const usesNext = checkIfHasPackage('next');
const usesReact = checkIfHasPackage('react');
const usesStrapiAboveV4 = checkIfHasPackage('@strapi/strapi');
const usesStrapi = checkIfHasPackage('strapi');
const reactVersion = usesReact ? semver.coerce(usesReact).version : undefined;

const config = {
Expand Down Expand Up @@ -80,8 +83,6 @@ if (hasWorkspaces) {

config.plugins.push('react');
config.rules = rulesForWorkspaces;

return;
}

if (usesReact || usesNext) {
Expand Down Expand Up @@ -126,5 +127,11 @@ if (usesNext) {
...next,
};
}
if (usesStrapiAboveV4 || usesStrapi) {
config.rules = {
...config.rules,
...strapi,
};
}

module.exports = config;
24 changes: 12 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ijsto/eslint-config",
"version": "4.1.7",
"version": "4.2.7",
"description": "ESLint and Prettier setup",
"author": "Scott Agirs Neminskis <scott@ijs.to>",
"repository": "git@github.com:ijsto/eslint-config.git",
Expand All @@ -11,30 +11,30 @@
},
"main": "index.js",
"peerDependencies": {
"eslint": "^7.25.0"
"eslint": "^7.25.0 || ^8.0.0"
},
"dependencies": {
"@babel/core": "^7.14.0",
"@babel/eslint-parser": "^7.13.14",
"@rushstack/eslint-patch": "^1.0.6",
"@babel/core": "^7.15.8",
"@babel/eslint-parser": "^7.15.8",
"@rushstack/eslint-patch": "^1.0.8",
"dot-prop": "^6.0.1",
"eslint-config-airbnb": "^18.2.1",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-html": "^6.1.2",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-html": "^6.2.0",
"eslint-plugin-import": "^2.25.2",
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^3.4.0",
"eslint-plugin-react": "^7.23.2",
"eslint-plugin-react-hooks": "^4.2.0",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-react": "^7.27.0",
"eslint-plugin-react-hooks": "^4.3.0",
"find-up": "5.0.0",
"prettier": "^2.3.0",
"read-pkg-up": "7.0.1",
"semver": "7.3.5"
},
"devDependencies": {
"eslint": "^7.26.0",
"prettier": "^2.3.0"
"eslint": "^8.0.0",
"prettier": "^2.4.1"
},
"keywords": [
"config",
Expand Down
2 changes: 1 addition & 1 deletion src/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ module.exports = {
'comma-dangle': 0,
'import/extensions': [
'error',
'ignorePackages',
{
js: 'never',
jsx: 'never',
svg: 'always',
ts: 'never',
tsx: 'never',
},
Expand Down
5 changes: 5 additions & 0 deletions src/strapi.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
// __ STRAPI.JS
'sort-keys': 0,
strict: 0,
};
Loading

0 comments on commit dc3e4a6

Please sign in to comment.