@alextheman/eslint-plugin 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +11897 -0
- package/dist/index.d.cts +15 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.js +11893 -0
- package/package.json +2 -1
- package/.github/workflows/ci.yml +0 -36
- package/.github/workflows/npm-publish.yml +0 -27
- package/.husky/pre-commit +0 -3
- package/__tests__/no-namespace-imports.test.ts +0 -24
- package/eslint.config.js +0 -3
- package/jest.config.js +0 -12
- package/src/createRule.ts +0 -7
- package/src/index.ts +0 -14
- package/src/rules/index.ts +0 -5
- package/src/rules/no-namespace-imports.ts +0 -33
- package/tsconfig.json +0 -27
- package/tsup.config.ts +0 -12
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alextheman/eslint-plugin",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "src/index.js",
|
|
6
|
+
"files": ["dist"],
|
|
6
7
|
"scripts": {
|
|
7
8
|
"test": "jest",
|
|
8
9
|
"format": "prettier --write --parser typescript 'src/**/*.ts' '__tests__/**/*.ts' && ESLINT_MODE=fix eslint --fix 'src/**/*.ts' '__tests__/**/*.ts'",
|
package/.github/workflows/ci.yml
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
|
|
2
|
-
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
|
|
3
|
-
|
|
4
|
-
name: Node.js CI
|
|
5
|
-
|
|
6
|
-
on:
|
|
7
|
-
push:
|
|
8
|
-
branches: [ "main" ]
|
|
9
|
-
pull_request:
|
|
10
|
-
branches: [ "main" ]
|
|
11
|
-
|
|
12
|
-
jobs:
|
|
13
|
-
ci:
|
|
14
|
-
|
|
15
|
-
runs-on: ubuntu-latest
|
|
16
|
-
|
|
17
|
-
strategy:
|
|
18
|
-
matrix:
|
|
19
|
-
node-version: [22.x]
|
|
20
|
-
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
|
|
21
|
-
|
|
22
|
-
steps:
|
|
23
|
-
- uses: actions/checkout@v4
|
|
24
|
-
- name: Use Node.js ${{ matrix.node-version }}
|
|
25
|
-
uses: actions/setup-node@v4
|
|
26
|
-
with:
|
|
27
|
-
node-version: ${{ matrix.node-version }}
|
|
28
|
-
cache: 'npm'
|
|
29
|
-
- name: Setup package
|
|
30
|
-
run: |
|
|
31
|
-
npm ci
|
|
32
|
-
npm run build --if-present
|
|
33
|
-
- name: Run tests
|
|
34
|
-
run: npm test
|
|
35
|
-
- name: Run linting checks
|
|
36
|
-
run: npm run lint
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
|
|
2
|
-
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
|
|
3
|
-
|
|
4
|
-
name: Node.js Package
|
|
5
|
-
|
|
6
|
-
on:
|
|
7
|
-
push:
|
|
8
|
-
branches:
|
|
9
|
-
- main
|
|
10
|
-
|
|
11
|
-
jobs:
|
|
12
|
-
publish-npm:
|
|
13
|
-
runs-on: ubuntu-latest
|
|
14
|
-
steps:
|
|
15
|
-
- uses: actions/checkout@v4
|
|
16
|
-
- uses: actions/setup-node@v4
|
|
17
|
-
with:
|
|
18
|
-
node-version: 20
|
|
19
|
-
registry-url: https://registry.npmjs.org/
|
|
20
|
-
- name: Install dependencies
|
|
21
|
-
run: npm ci
|
|
22
|
-
- name: Build package
|
|
23
|
-
run: npm run build
|
|
24
|
-
- name: Publish to npm
|
|
25
|
-
run: npm publish --access public
|
|
26
|
-
env:
|
|
27
|
-
NODE_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}}
|
package/.husky/pre-commit
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { RuleTester } from "@typescript-eslint/rule-tester";
|
|
2
|
-
import rules from "src/rules";
|
|
3
|
-
|
|
4
|
-
const ruleTester = new RuleTester({
|
|
5
|
-
languageOptions: { ecmaVersion: "latest" },
|
|
6
|
-
});
|
|
7
|
-
|
|
8
|
-
ruleTester.run("no-namespace-imports", rules["no-namespace-imports"], {
|
|
9
|
-
valid: [
|
|
10
|
-
{
|
|
11
|
-
code: 'import { useState } from "react"',
|
|
12
|
-
},
|
|
13
|
-
],
|
|
14
|
-
invalid: [
|
|
15
|
-
{
|
|
16
|
-
code: 'import * as React from "react"',
|
|
17
|
-
errors: [
|
|
18
|
-
{
|
|
19
|
-
messageId: "message",
|
|
20
|
-
},
|
|
21
|
-
],
|
|
22
|
-
},
|
|
23
|
-
],
|
|
24
|
-
});
|
package/eslint.config.js
DELETED
package/jest.config.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { createDefaultPreset } from "ts-jest";
|
|
2
|
-
|
|
3
|
-
const tsJestTransformCfg = createDefaultPreset().transform;
|
|
4
|
-
|
|
5
|
-
/** @type {import("jest").Config} **/
|
|
6
|
-
export default {
|
|
7
|
-
testEnvironment: "node",
|
|
8
|
-
transform: {
|
|
9
|
-
...tsJestTransformCfg,
|
|
10
|
-
},
|
|
11
|
-
moduleDirectories: ["node_modules", "."]
|
|
12
|
-
};
|
package/src/createRule.ts
DELETED
package/src/index.ts
DELETED
package/src/rules/index.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import createRule from "src/createRule";
|
|
2
|
-
|
|
3
|
-
const noNamespaceImports = createRule({
|
|
4
|
-
name: "no-namespace-imports",
|
|
5
|
-
meta: {
|
|
6
|
-
docs: {
|
|
7
|
-
description: "Forbid the use of import *",
|
|
8
|
-
},
|
|
9
|
-
messages: {
|
|
10
|
-
message: "Import * is not allowed. Please use named imports instead.",
|
|
11
|
-
},
|
|
12
|
-
type: "suggestion",
|
|
13
|
-
schema: [],
|
|
14
|
-
},
|
|
15
|
-
defaultOptions: [],
|
|
16
|
-
create(context) {
|
|
17
|
-
return {
|
|
18
|
-
ImportDeclaration(node) {
|
|
19
|
-
if (node.specifiers[0].type === "ImportNamespaceSpecifier") {
|
|
20
|
-
context.report({
|
|
21
|
-
node,
|
|
22
|
-
messageId: "message",
|
|
23
|
-
data: {
|
|
24
|
-
source: node.source,
|
|
25
|
-
},
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
};
|
|
30
|
-
},
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
export default noNamespaceImports;
|
package/tsconfig.json
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ES6",
|
|
4
|
-
"useDefineForClassFields": true,
|
|
5
|
-
"lib": ["ES2024"],
|
|
6
|
-
"types": ["eslint"],
|
|
7
|
-
"module": "ESNext",
|
|
8
|
-
"skipLibCheck": true,
|
|
9
|
-
"baseUrl": ".",
|
|
10
|
-
"paths": {
|
|
11
|
-
"src/*": ["src/*"]
|
|
12
|
-
},
|
|
13
|
-
"esModuleInterop": true,
|
|
14
|
-
|
|
15
|
-
"moduleResolution": "bundler",
|
|
16
|
-
"resolveJsonModule": true,
|
|
17
|
-
"isolatedModules": true,
|
|
18
|
-
"outDir": "dist",
|
|
19
|
-
|
|
20
|
-
"strict": true,
|
|
21
|
-
"noUnusedLocals": true,
|
|
22
|
-
"noUnusedParameters": true,
|
|
23
|
-
"noFallthroughCasesInSwitch": true,
|
|
24
|
-
"declaration": true
|
|
25
|
-
},
|
|
26
|
-
"include": ["src", "__tests__"]
|
|
27
|
-
}
|
package/tsup.config.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from "tsup";
|
|
2
|
-
import packageInfo from "./package.json"
|
|
3
|
-
|
|
4
|
-
export default defineConfig({
|
|
5
|
-
entry: ["src/index.ts"],
|
|
6
|
-
format: ["esm", "cjs"],
|
|
7
|
-
dts: true,
|
|
8
|
-
clean: true,
|
|
9
|
-
external: [
|
|
10
|
-
...Object.keys(packageInfo.peerDependencies)
|
|
11
|
-
]
|
|
12
|
-
});
|