Skip to content

Commit

Permalink
chore: use modern eslint and limit engines (#735)
Browse files Browse the repository at this point in the history
* chore: use modern eslint and limit engines

* update fs promises

* use node >= 12
  • Loading branch information
huozhi committed Aug 17, 2021
1 parent 7c04667 commit 8f4404a
Show file tree
Hide file tree
Showing 6 changed files with 339 additions and 969 deletions.
1 change: 1 addition & 0 deletions babel-test.js
@@ -1 +1,2 @@
/* eslint-ignore */
module.exports = require('./dist/babel-test')
1 change: 1 addition & 0 deletions lib/style-transform.js
@@ -1 +1,2 @@
/* eslint-ignore */
module.exports = require('../dist/lib/style-transform')
37 changes: 21 additions & 16 deletions package.json
Expand Up @@ -23,7 +23,7 @@
"scripts": {
"build": "babel src --out-dir dist",
"test": "ava",
"lint": "xo",
"lint": "eslint ./src",
"prepublishOnly": "yarn build && yarn test && yarn lint --quiet"
},
"husky": {
Expand All @@ -36,23 +36,26 @@
"@babel/register"
]
},
"xo": {
"envs": [
"node",
"browser"
],
"extends": "prettier",
"ignores": [
"lib/style-transform.js",
"babel-test.js"
"eslintConfig": {
"env": {
"node": true,
"browser": true,
"es6": true
},
"extends": [
"eslint:recommended",
"prettier"
],
"parserOptions": {
"ecmaVersion": 11,
"sourceType": "module"
},
"rules": {
"no-empty": 0,
"capitalized-comments": 0,
"valid-jsdoc": 0,
"prefer-destructuring": 0,
"padding-line-between-statements": 0,
"unicorn/prefer-node-append": 0,
"unicorn/prefer-query-selector": 0
"padding-line-between-statements": 0
}
},
"dependencies": {
Expand All @@ -78,19 +81,21 @@
"@babel/runtime": "7.12.5",
"ava": "1.2.1",
"babel-plugin-macros": "2.8.0",
"eslint": "7.32.0",
"eslint-config-prettier": "4.0.0",
"husky": "4.3.0",
"mz": "2.7.0",
"prettier": "1.16.4",
"pretty-quick": "3.1.0",
"react": "17.0.1",
"react-dom": "17.0.1",
"semantic-release": "17.2.2",
"xo": "0.24.0"
"semantic-release": "17.2.2"
},
"peerDependencies": {
"react": ">= 16.8.0 || 17.x.x || 18.x.x"
},
"engines": {
"node": ">= 12.0.0"
},
"keywords": [
"babel-plugin-macros",
"vercel",
Expand Down
2 changes: 0 additions & 2 deletions src/lib/style-transform.js
Expand Up @@ -4,7 +4,6 @@ const stylisRuleSheet = require('stylis-rule-sheet')
const stylis = new Stylis()

function disableNestingPlugin(...args) {
// eslint-disable-next-line unicorn/no-unreadable-array-destructuring
let [context, , , parent = [], line, column] = args
if (context === 2) {
// replace null characters and trim
Expand All @@ -24,7 +23,6 @@ let filename
let offset

function sourceMapsPlugin(...args) {
// eslint-disable-next-line unicorn/no-unreadable-array-destructuring
const [context, , , , line, column, length] = args

// Pre-processed, init source map
Expand Down
4 changes: 2 additions & 2 deletions test/_read.js
@@ -1,7 +1,7 @@
import { resolve } from 'path'
import { readFile } from 'mz/fs'
import { promises as fs } from 'fs'

export default async path => {
const buffer = await readFile(resolve(__dirname, path))
const buffer = await fs.readFile(resolve(__dirname, path))
return buffer.toString()
}

0 comments on commit 8f4404a

Please sign in to comment.