Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: bump eslint and node versions #488

Merged
merged 5 commits into from
Aug 31, 2022
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
2 changes: 1 addition & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://unpkg.com/@changesets/config@1.6.0/schema.json",
"$schema": "https://unpkg.com/@changesets/config/schema.json",
"changelog": [
"@changesets/changelog-github",
{
Expand Down
5 changes: 5 additions & 0 deletions .changeset/old-plants-exist.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'eslint-plugin-prettier': major
---

feat!: bump peer eslint to ">=8.0.0" and node to "^14.18.0 || >=16.0.0"
3 changes: 2 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
{
"files": "test/*.js",
"rules": {
"no-magic-numbers": "off"
"no-magic-numbers": "off",
"unicorn/prefer-top-level-await": "off"
}
}
]
Expand Down
12 changes: 3 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,14 @@ on:

jobs:
ci:
name: 'Test: Node ${{ matrix.node-version }} - ESLint ${{ matrix.eslint-version }}'
name: Lint and Test on Node ${{ matrix.node-version }}
runs-on: ubuntu-latest
strategy:
matrix:
eslint-version:
- 7
- 8
node-version:
- 12
- 14
- 16
- 18

steps:
- uses: actions/checkout@v3
Expand All @@ -29,11 +26,8 @@ jobs:
node-version: ${{ matrix.node-version }}
cache: yarn

- name: Use ESLint ${{ matrix.eslint-version }}
run: yarn upgrade eslint@${{ matrix.eslint-version }} --ignore-engines

- name: Install
run: yarn --frozen-lockfile --ignore-engines
run: yarn --frozen-lockfile

- name: Test
run: yarn mocha
Expand Down
2 changes: 1 addition & 1 deletion .remarkrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"plugins": [
"@1stg/remark-config"
"@1stg/preset"
]
}
74 changes: 21 additions & 53 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@
"description": "Runs prettier as an eslint rule",
"repository": "git+https://github.com/prettier/eslint-plugin-prettier.git",
"homepage": "https://github.com/prettier/eslint-plugin-prettier#readme",
"funding": "https://opencollective.com/prettier",
"author": "Teddy Katz",
"contributors": [
"JounQin (https://github.com/JounQin) <admin@1stg.me>"
],
"funding": "https://opencollective.com/prettier",
"license": "MIT",
"packageManager": "yarn@1.22.19",
"engines": {
"node": ">=12.0.0"
"node": "^14.18.0 || >=16.0.0"
},
"main": "eslint-plugin-prettier.js",
"files": [
Expand All @@ -26,13 +27,13 @@
"scripts": {
"format": "yarn prettier '**/*.{js,json,md,yml}' --write && yarn lint --fix",
"lint": "eslint . --cache -f friendly --max-warnings 10",
"prepare": "patch-package && simple-git-hooks && yarn-deduplicate --strategy fewer || exit 0",
"prepare": "simple-git-hooks && yarn-deduplicate --strategy fewer || exit 0",
"prerelease": "yarn format && yarn test",
"release": "changeset publish",
"test": "yarn lint && mocha"
},
"peerDependencies": {
"eslint": ">=7.28.0",
"eslint": ">=8.0.0",
"prettier": ">=2.0.0"
},
"peerDependenciesMeta": {
Expand All @@ -41,63 +42,30 @@
}
},
"dependencies": {
"eslint-plugin-prettier": "link:.",
"prettier-linter-helpers": "^1.0.0"
},
"devDependencies": {
"@1stg/common-config": "~3.0.0",
"@1stg/eslint-config": "~3.0.0",
"@changesets/changelog-github": "^0.4.5",
"@changesets/cli": "^2.23.1",
"@graphql-eslint/eslint-plugin": "^2.5.0",
"@typescript-eslint/parser": "^5.30.5",
"@1stg/common-config": "^7.1.1",
"@changesets/changelog-github": "^0.4.6",
"@changesets/cli": "^2.24.4",
"@graphql-eslint/eslint-plugin": "^3.10.7",
"@typescript-eslint/parser": "^5.36.1",
"eslint-config-prettier": "^8.5.0",
"eslint-mdx": "^1.17.1",
"eslint-plugin-eslint-plugin": "^4.4.0",
"eslint-plugin-mdx": "^1.17.1",
"eslint-mdx": "^2.0.2",
"eslint-plugin-eslint-plugin": "^5.0.6",
"eslint-plugin-mdx": "^2.0.2",
"eslint-plugin-self": "^1.2.1",
"eslint-plugin-svelte": "~2.1.0",
"eslint-plugin-utils": "^0.1.0",
"graphql": "^16.5.0",
"mocha": "^9.2.2",
"patch-package": "^6.4.7",
"eslint-plugin-svelte": "^2.7.0",
"eslint-plugin-svelte3": "^4.0.0",
"graphql": "^16.6.0",
"mocha": "^10.0.0",
"svelte": "^3.49.0",
"vue-eslint-parser": "^8.3.0"
"vue-eslint-parser": "^9.0.3",
"yarn-deduplicate": "^6.0.0"
},
"resolutions": {
"@babel/traverse": "^7.18.5",
"eslint-plugin-prettier": "link:.",
"prettier": "^2.7.1"
},
"donate": {
"recipients": [
{
"name": "unts",
"platform": "opencollective",
"address": "https://opencollective.com/unts",
"weight": 60
},
{
"name": "rxts",
"platform": "opencollective",
"address": "https://opencollective.com/rxts",
"weight": 20
},
{
"name": "1stG",
"email": "i@1stg.me",
"weight": 20,
"platforms": [
{
"platform": "opencollective",
"address": "https://opencollective.com/1stG"
},
{
"platform": "patreon",
"address": "https://www.patreon.com/1stG"
}
]
}
]
},
"packageManager": "yarn@1.22.19"
}
}
13 changes: 0 additions & 13 deletions patches/@1stg+lint-staged+1.7.5.patch

This file was deleted.

21 changes: 0 additions & 21 deletions patches/@pkgr+utils+2.2.0.patch

This file was deleted.

21 changes: 12 additions & 9 deletions test/prettier.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
// Requirements
// ------------------------------------------------------------------------------

const assert = require('assert');
const fs = require('fs');
const path = require('path');
const assert = require('node:assert');
const fs = require('node:fs');
const path = require('node:path');

const { ESLint, RuleTester } = require('eslint');

Expand All @@ -31,7 +31,7 @@ const rule = eslintPluginPrettier.rules.prettier;
const eslint = new ESLint({
baseConfig: {
parserOptions: {
ecmaVersion: 2021,
ecmaVersion: 'latest',
ecmaFeatures: {
jsx: true,
},
Expand Down Expand Up @@ -184,7 +184,9 @@ atGraphqlEslintRuleTester.run('@graphql-eslint/eslint-plugin', rule, {
// `newRuleTester({processor: require('eslint-plugin-graphql').processor['.graphql']})
// and then pass in pure graphql into the code value.
const eslintPluginGraphqlRuleTester = new RuleTester({
parserOptions: { ecmaVersion: 2015 },
parserOptions: {
ecmaVersion: 'latest',
},
});

eslintPluginGraphqlRuleTester.run('eslint-plugin-graphql', rule, {
Expand All @@ -199,7 +201,10 @@ eslintPluginGraphqlRuleTester.run('eslint-plugin-graphql', rule, {

const mdxRuleTester = new RuleTester({
parser: require.resolve('eslint-mdx'),
parserOptions: require('eslint-mdx').DEFAULT_PARSER_OPTIONS,
parserOptions: {
sourceType: 'module',
ecmaVersion: 'latest',
},
});

mdxRuleTester.run('eslint-plugin-mdx', rule, {
Expand Down Expand Up @@ -309,9 +314,7 @@ runFixture('eslint-plugin-svelte3/*.svelte', [[], []]);
function loadInvalidFixture(name) {
const filename = path.join(__dirname, 'invalid', name + '.txt');
const src = fs.readFileSync(filename, 'utf8');
const sections = src
.split(/^[A-Z]+:\n/m)
.map(x => x.replace(/(?=\n)\n$/, ''));
const sections = src.split(/^[A-Z]+:\n/m).map(x => x.replace(/\n$/, ''));
const item = {
code: sections[1],
output: sections[2],
Expand Down
Loading