Skip to content

Commit

Permalink
test: keep working
Browse files Browse the repository at this point in the history
  • Loading branch information
JounQin committed Jan 21, 2024
1 parent 5c45b6f commit 41e35cb
Show file tree
Hide file tree
Showing 165 changed files with 7,664 additions and 8,055 deletions.
2 changes: 0 additions & 2 deletions .coveralls.yml

This file was deleted.

1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ test/fixtures/cycles/flow-typeof.js
test/fixtures/flowtypes.js
# unexpected - TODO: report to babel
test/fixtures/jsx.js
!/.*.js
39 changes: 36 additions & 3 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
"eslint:recommended",
"plugin:eslint-plugin/recommended",
"plugin:i/recommended",
"plugin:unicorn/recommended",
"plugin:prettier/recommended"
],
"env": {
"es6": true,
"es2023": true,
"node": true
},
"parserOptions": {
Expand All @@ -19,20 +20,52 @@
}
},
"rules": {
"no-var": "error",
"i/order": [
"error",
{
"alphabetize": {
"order": "asc",
"orderImportKind": "asc"
},
"newlines-between": "always"
}
]
],
"i/no-self-import": "error",
"unicorn/filename-case": "off",
"unicorn/no-array-callback-reference": "off",
"unicorn/no-array-for-each": "off",
"unicorn/no-array-reduce": "off",
"unicorn/no-null": "off",
"unicorn/prefer-at": "off",
"unicorn/prefer-module": "off",
"unicorn/prefer-node-protocol": "off",
"unicorn/prevent-abbreviations": "off",
"unicorn/prefer-spread": "off"
},
"overrides": [
{
"files": "test/src/**/*.spec.js",
"files": "test/**/*.spec.js",
"excludedFiles": "test/fixtures/**/*.js",
"extends": "plugin:jest/recommended",
"env": {
"jest": true
}
},
{
"files": "test/fixtures/**/*.js",
"rules": {
"no-undef": "off",
"no-unused-modules": "off",
"no-unused-vars": "off",
"i/default": "off",
"i/export": "off",
"i/named": "off",
"i/no-duplicates": "off",
"i/no-self-import": "off",
"i/no-unresolved": "off",
"unicorn/no-empty-file": "off"
}
}
]
}
8 changes: 5 additions & 3 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
/**
* @type {import('@babel/core').TransformOptions}
*/
module.exports = {
presets: [
'@babel/flow',
[
'@1stg',
{
modules: 'commonjs',
typescript: true,
},
],
],
plugins: ['@babel/proposal-export-default-from'],
targets: {
node: 'current',
},
overrides: [
{
test: './test/fixtures/jsx.js',
Expand Down
13 changes: 0 additions & 13 deletions config/react-native.js

This file was deleted.

4 changes: 2 additions & 2 deletions docs/rules/extensions.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ import Component from './Component'

import express from 'express/index'

import * as path from 'path'
import path from 'path'
```

The following patterns are considered problems when configuration set to "always":
Expand All @@ -125,7 +125,7 @@ import bar from './bar.json'

import Component from './Component.jsx'

import * as path from 'path'
import path from 'path'

import foo from '@/foo.js'
```
Expand Down
16 changes: 8 additions & 8 deletions docs/rules/no-restricted-paths.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ and the current configuration is set to:
{
"zones": [
{
"target": "./tests/files/restricted-paths/server/one",
"from": "./tests/files/restricted-paths/server",
"target": "./test/fixtures/restricted-paths/server/one",
"from": "./test/fixtures/restricted-paths/server",
"except": ["./one"]
}
]
Expand Down Expand Up @@ -119,8 +119,8 @@ and the current configuration is set to:
{
"zones": [
{
"target": "./tests/files/restricted-paths/client/!(sub-module)/**/*",
"from": "./tests/files/restricted-paths/client/sub-module/**/*"
"target": "./test/fixtures/restricted-paths/client/!(sub-module)/**/*",
"from": "./test/fixtures/restricted-paths/client/sub-module/**/*"
}
]
}
Expand Down Expand Up @@ -162,12 +162,12 @@ and the current configuration is set to:
"zones": [
{
"target": [
"./tests/files/restricted-paths/two/*",
"./tests/files/restricted-paths/three/*"
"./test/fixtures/restricted-paths/two/*",
"./test/fixtures/restricted-paths/three/*"
],
"from": [
"./tests/files/restricted-paths/one",
"./tests/files/restricted-paths/three"
"./test/fixtures/restricted-paths/one",
"./test/fixtures/restricted-paths/three"
]
}
]
Expand Down
7 changes: 7 additions & 0 deletions jsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "@1stg/tsconfig/node",
"compilerOptions": {
"allowJs": true,
"noEmit": true
}
}
37 changes: 34 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "eslint-plugin-i",
"version": "2.29.1",
"type": "commonjs",
"description": "A fork of `eslint-plugin-import` using `get-tsconfig` to replace `tsconfig-paths` and heavy `typescript` under the hood.",
"repository": {
"type": "git",
Expand All @@ -16,6 +17,11 @@
"node": ">=12"
},
"main": "lib/index.js",
"exports": {
".": "./lib/index.js",
"./*": "./lib/*.js",
"./package.json": "./package.json"
},
"directories": {
"test": "tests"
},
Expand All @@ -36,33 +42,40 @@
"export"
],
"scripts": {
"build": "rimraf lib && babel src -d lib",
"build": "rimraf lib && babel src -s -d lib",
"lint": "yarn build && eslint . --cache",
"prepare": "patch-package && yarn-deduplicate -s fewer",
"test": "yarn build && jest",
"update:eslint-docs": "yarn build && eslint-doc-generator --rule-doc-title-format prefix-name --rule-doc-section-options false --rule-list-split meta.docs.category --ignore-config stage-0 --config-emoji recommended,☑️"
},
"peerDependencies": {
"eslint": "^7.2.0 || ^8"
},
"dependencies": {
"debug": "^4.3.4",
"doctrine": "^3.0.0",
"enhanced-resolve": "^5.15.0",
"get-tsconfig": "^4.7.2",
"is-glob": "^4.0.3",
"minimatch": "^3.1.2",
"semver": "^7.5.4"
"minimatch": "^3.1.2"
},
"devDependencies": {
"@1stg/babel-preset": "^4.0.0",
"@1stg/prettier-config": "^4.0.1",
"@1stg/tsconfig": "^2.3.3",
"@angular-eslint/template-parser": "^17.2.0",
"@babel/cli": "^7.23.4",
"@babel/core": "^7.23.7",
"@babel/eslint-parser": "^7.23.3",
"@babel/plugin-proposal-export-default-from": "^7.23.3",
"@babel/preset-flow": "^7.23.3",
"@babel/preset-react": "^7.23.3",
"@test-scope/some-module": "link:./test/fixtures/symlinked-module",
"@types/eslint": "^8.56.2",
"@types/eslint7": "npm:@types/eslint@7",
"@types/jest": "^29.5.11",
"@types/node": "^20.11.5",
"@typescript-eslint/parser": "^6.19.0",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-module-utils": "link:utils",
Expand All @@ -71,10 +84,28 @@
"eslint-plugin-jest": "^27.6.3",
"eslint-plugin-json": "^3.1.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-unicorn": "^50.0.1",
"jest": "^29.7.0",
"patch-package": "^8.0.0",
"prettier": "^3.2.4",
"rimraf": "^5.0.5",
"semver": "^7.5.4",
"typescript": "^5.3.3",
"yarn-deduplicate": "^6.0.2"
},
"jest": {
"collectCoverage": true,
"modulePathIgnorePatterns": [
"<rootDir>/test/fixtures/with-syntax-error"
],
"moduleNameMapper": {
"^eslint-plugin-i$": "<rootDir>/src/index.js",
"^eslint-plugin-i/package.json$": "<rootDir>/package.json",
"^eslint-plugin-i/(.+)$": "<rootDir>/src/$1"
},
"testMatch": [
"<rootDir>/test/**/*.spec.js",
"!<rootDir>/test/fixtures/**/*.js"
]
}
}
13 changes: 13 additions & 0 deletions patches/cliui+8.0.1.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/node_modules/cliui/build/index.cjs b/node_modules/cliui/build/index.cjs
index 82126b6..009c42d 100644
--- a/node_modules/cliui/build/index.cjs
+++ b/node_modules/cliui/build/index.cjs
@@ -289,7 +289,7 @@ function cliui(opts, _mixin) {

// Bootstrap cliui with CommonJS dependencies:
const stringWidth = require('string-width');
-const stripAnsi = require('strip-ansi');
+const stripAnsi = require('strip-ansi-cjs');
const wrap = require('wrap-ansi');
function ui(opts) {
return cliui(opts, {
11 changes: 11 additions & 0 deletions patches/string-length+4.0.2.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
diff --git a/node_modules/string-length/index.js b/node_modules/string-length/index.js
index c2589a2..3040f0a 100644
--- a/node_modules/string-length/index.js
+++ b/node_modules/string-length/index.js
@@ -1,5 +1,5 @@
'use strict';
-const stripAnsi = require('strip-ansi');
+const stripAnsi = require('strip-ansi-cjs');
const charRegex = require('char-regex');

const stringLength = string => {
11 changes: 11 additions & 0 deletions patches/string-width+4.2.3.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
diff --git a/node_modules/string-width/index.js b/node_modules/string-width/index.js
index f4d261a..7ea642a 100644
--- a/node_modules/string-width/index.js
+++ b/node_modules/string-width/index.js
@@ -1,5 +1,5 @@
'use strict';
-const stripAnsi = require('strip-ansi');
+const stripAnsi = require('strip-ansi-cjs');
const isFullwidthCodePoint = require('is-fullwidth-code-point');
const emojiRegex = require('emoji-regex');

12 changes: 12 additions & 0 deletions patches/wrap-ansi+7.0.0.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/node_modules/wrap-ansi/index.js b/node_modules/wrap-ansi/index.js
index d502255..1ed059c 100755
--- a/node_modules/wrap-ansi/index.js
+++ b/node_modules/wrap-ansi/index.js
@@ -1,6 +1,6 @@
'use strict';
const stringWidth = require('string-width');
-const stripAnsi = require('strip-ansi');
+const stripAnsi = require('strip-ansi-cjs');
const ansiStyles = require('ansi-styles');

const ESCAPES = new Set([
Loading

0 comments on commit 41e35cb

Please sign in to comment.