Skip to content

Commit 9d71b4f

Browse files
committed
feat(no-ref): readme
1 parent 7c7b6b3 commit 9d71b4f

File tree

4 files changed

+24
-35
lines changed

4 files changed

+24
-35
lines changed

README.md

+22-28
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,33 @@
1-
<!--
2-
This README describes the package. If you publish this package to pub.dev,
3-
this README's contents appear on the landing page for your package.
1+
# jsdaddy_custom_lints
42

5-
For information about how to write a good package README, see the guide for
6-
[writing package pages](https://dart.dev/guides/libraries/writing-package-pages).
7-
8-
For general information about developing packages, see the Dart guide for
9-
[creating packages](https://dart.dev/guides/libraries/create-library-packages)
10-
and the Flutter guide for
11-
[developing packages and plugins](https://flutter.dev/developing-packages).
12-
-->
13-
14-
TODO: Put a short description of the package here that helps potential users
15-
know whether this package might be useful for them.
3+
`jsdaddy_custom_lints` is a Dart package designed to enforce a custom lint rule that ensures file names follow the kebab-case convention. This package is useful for maintaining consistent file naming conventions across your Dart and Flutter projects.
164

175
## Features
186

19-
TODO: List what your package can do. Maybe include images, gifs, or videos.
7+
- Enforces file names to be in lowercase and use hyphens (`-`) instead of underscores (`_`).
8+
- Integrates with the `custom_lint` package to provide real-time linting in your IDE.
209

21-
## Getting started
10+
## Installation
2211

23-
TODO: List prerequisites and provide or point to information on how to
24-
start using the package.
12+
Add `jsdaddy_custom_lints` to your `pubspec.yaml` file:
2513

14+
```yaml
15+
dev_dependencies:
16+
jsdaddy_custom_lints:
17+
git:
18+
url: https://github.com/JsDaddy/dart-linter-rules
19+
```
2620
## Usage
2721
28-
TODO: Include short and useful examples for package users. Add longer examples
29-
to `/example` folder.
22+
To use the custom lint rule, add the following configuration to your `analysis_options.yaml` file:
3023

31-
```dart
32-
const like = 'sample';
24+
```yaml
25+
analyzer:
26+
plugins:
27+
- custom_lint
28+
custom_lint:
29+
enable_all_lint_rules: false
30+
rules:
31+
- file_naming_kebab_case
3332
```
34-
35-
## Additional information
36-
37-
TODO: Tell users more about the package: where to find more information, how to
38-
contribute to the package, how to file issues, what response they can expect
39-
from the package authors, and more.
33+
This configuration will enable the file_naming_kebab_case rule, ensuring that all Dart files are checked for compliance with the kebab-case naming convention.

lib/jsdaddy_custom_lints.dart

+1-5
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,11 @@ library jsdaddy_custom_lints;
33
import 'package:custom_lint_builder/custom_lint_builder.dart';
44
import 'src/rules/file_naming_kebab_case.dart';
55

6-
PluginBase createPlugin() {
7-
print('Custom lint plugin loaded');
8-
return _CustomLints();
9-
}
6+
PluginBase createPlugin() => _CustomLints();
107

118
class _CustomLints extends PluginBase {
129
@override
1310
List<LintRule> getLintRules(CustomLintConfigs config) {
14-
print('Getting lint rules');
1511
return <LintRule>[
1612
const FileNamingKebabCaseLint(),
1713
];

lib/src/rules/file_naming_kebab_case.dart

-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ class FileNamingKebabCaseLint extends DartLintRule {
2424
ErrorReporter reporter,
2525
CustomLintContext context,
2626
) async {
27-
print('FileNamingLint rule is running');
28-
2927
final ResolvedUnitResult unit = await resolver.getResolvedUnitResult();
3028
final String fileName = unit.unit.declaredElement?.source.shortName ?? '';
3129
if (!_isValidFileName(fileName)) {

pubspec.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ environment:
99
dependencies:
1010
analyzer: ^6.4.1
1111
analyzer_plugin: ^0.11.3
12+
custom_lint: ^0.6.4
1213
custom_lint_builder: ^0.6.4
1314

1415
dev_dependencies:

0 commit comments

Comments
 (0)